神经网络

From Ufldl

Jump to: navigation, search
Line 193: Line 193:
<math>a^{(l)}_i = f(z^{(l)}_i)</math>.
<math>a^{(l)}_i = f(z^{(l)}_i)</math>.
-
【初译】下面,我们用表示层l节点i的加权后输入量与偏置项之和(例如,),这样。
+
【初译】下面,我们用<math>z^{(l)}_i</math>表示层<math>l</math>节点<math>i</math>的加权后输入量与偏置项之和(例如,<math>\textstyle z_i^{(2)} = \sum_{j=1}^n W^{(1)}_{ij} x_j + b^{(1)}_i</math>),这样<math>a^{(l)}_i = f(z^{(l)}_i)</math>。
-
【一审】我们用表示第  层第i单元输入的加权总和(包括偏置单元),比如,,则。
+
【一审】我们用<math>z^{(l)}_i</math>表示第<math>l</math>层第<math>i</math>单元输入的加权总和(包括偏置单元),比如,<math>\textstyle z_i^{(2)} = \sum_{j=1}^n W^{(1)}_{ij} x_j + b^{(1)}_i</math>,则<math>a^{(l)}_i = f(z^{(l)}_i)</math>。
-
【二审】我们用表示第  层第i单元输入值的加权总和(包括偏置单元),比如,,则。
+
【二审】我们用<math>z^{(l)}_i</math>表示第<math>l</math>层第<math>i</math>单元输入值的加权总和(包括偏置单元),比如,<math>\textstyle z_i^{(2)} = \sum_{j=1}^n W^{(1)}_{ij} x_j + b^{(1)}_i</math>,则<math>a^{(l)}_i = f(z^{(l)}_i)</math>。
-
【原文】Note that this easily lends itself to a more compact notation. Specifically, if we extend the activation function to apply to vectors in an element-wise fashion (i.e., f([z1,z2,z3]) = [f(z1),f(z2),f(z3)]), then we can write the equations above more compactly as:  
+
【原文】Note that this easily lends itself to a more compact notation. Specifically, if we extend the activation function <math>f(\cdot)</math>
 +
to apply to vectors in an element-wise fashion (i.e.,
 +
<math>f([z_1, z_2, z_3]) = [f(z_1), f(z_2), f(z_3)]</math>), then we can write
 +
the equations above more
 +
compactly as:
 +
:<math>\begin{align}
 +
z^{(2)} &= W^{(1)} x + b^{(1)} \\
 +
a^{(2)} &= f(z^{(2)}) \\
 +
z^{(3)} &= W^{(2)} a^{(2)} + b^{(2)} \\
 +
h_{W,b}(x) &= a^{(3)} = f(z^{(3)})
 +
\end{align}</math>
 +
【初译】这样可以推导出一个更简洁的表示法。特别地,如果我们扩展激活函数<math>f(\cdot)</math>为向量形式(例如,<math>f([z_1, z_2, z_3]) = [f(z_1), f(z_2), f(z_3)]</math>),这样我们可以使等式更为简洁:
-
【初译】这样可以推导出一个更简洁的表示法。特别地,如果我们扩展激活函数为向量形式(例如,f([z1,z2,z3]) = [f(z1),f(z2),f(z3)]),这样我们可以使等式更为简洁:
+
:<math>\begin{align}
 +
z^{(2)} &= W^{(1)} x + b^{(1)} \\
 +
a^{(2)} &= f(z^{(2)}) \\
 +
z^{(3)} &= W^{(2)} a^{(2)} + b^{(2)} \\
 +
h_{W,b}(x) &= a^{(3)} = f(z^{(3)})
 +
\end{align}</math>
-
【一审】这样我们就可以很容易地找到一种更紧凑的表示法。特别是,如果我们将激活函数扩展为用向量(分量的形式)来表示,就如,f([z1,z2,z3]) = [f(z1),f(z2),f(z3)],那么,上面的等式我们就可以用一种更精简的方式表示:
+
【一审】这样我们就可以很容易地找到一种更紧凑的表示法。特别是,如果我们将激活函数<math>f(\cdot)</math>扩展为用向量(分量的形式)来表示,就如,<math>f([z_1, z_2, z_3]) = [f(z_1), f(z_2), f(z_3)]</math>,那么,上面的等式我们就可以用一种更精简的方式表示:
 +
:<math>\begin{align}
 +
z^{(2)} &= W^{(1)} x + b^{(1)} \\
 +
a^{(2)} &= f(z^{(2)}) \\
 +
z^{(3)} &= W^{(2)} a^{(2)} + b^{(2)} \\
 +
h_{W,b}(x) &= a^{(3)} = f(z^{(3)})
 +
\end{align}</math>
-
【二审】这样我们就可以找到一种更简洁的表示法。这里我们将激活函数扩展为用向量(分量的形式)来表示,即是f([z1,z2,z3]) = [f(z1),f(z2),f(z3)],那么,上面的等式我们就可以表示为:
+
【二审】这样我们就可以找到一种更简洁的表示法。这里我们将激活函数<math>f(\cdot)</math>扩展为用向量(分量的形式)来表示,即是<math>f([z_1, z_2, z_3]) = [f(z_1), f(z_2), f(z_3)]</math>,那么,上面的等式我们就可以表示为:
 +
:<math>\begin{align}
 +
z^{(2)} &= W^{(1)} x + b^{(1)} \\
 +
a^{(2)} &= f(z^{(2)}) \\
 +
z^{(3)} &= W^{(2)} a^{(2)} + b^{(2)} \\
 +
h_{W,b}(x) &= a^{(3)} = f(z^{(3)})
 +
\end{align}</math>
-
【原文】We call this step forward propagation. More generally, recalling that we also use a(1) = x to also denote the values from the input layer, then given layer 's activations a(l), we can compute layer + 1's activations a(l + 1) as:  
+
【原文】We call this step '''forward propagation.'''  More generally, recalling that we also use <math>a^{(1)} = x</math> to also denote the values from the input layer,then given layer <math>l</math>'s activations <math>a^{(l)}</math>, we can compute layer <math>l+1</math>'s activations <math>a^{(l+1)}</math> as:
 +
:<math>\begin{align}
 +
z^{(l+1)} &= W^{(l)} a^{(l)} + b^{(l)}  \\
 +
a^{(l+1)} &= f(z^{(l+1)})
 +
\end{align}</math>
-
【初译】我们称这个步骤为正向传播。更一般化,回想我们用到a(1) = x来表示输入层的输出值,给定层l激活(输出)值a(l),我们可以计算层l+1激活(输出)值a(l + 1)
+
【初译】我们称这个步骤为'''正向传播'''。更一般化,回想我们用到<math>a^{(1)} = x</math> 来表示输入层的输出值,给定层<math>l</math>激活(输出)值<math>a^{(l)}</math>,我们可以计算层<math>l+1</math>激活(输出)值<math>a^{(l+1)}</math>
-
【一审】我们将这种步骤叫作“前向传导”。回想一下,之前我们也用a(1) = x表示输入层的激活值,那么第  层的激活值更通用的表示就是a(l),而第  +1层的激活值a(l + 1)就可以由以下方式计算得到:
+
:<math>\begin{align}
 +
z^{(l+1)} &= W^{(l)} a^{(l)} + b^{(l)}  \\
 +
a^{(l+1)} &= f(z^{(l+1)})
 +
\end{align}</math>
-
【二审】我们将这种步骤叫作“正向传播”。回想一下,之前我们也用a(1) = x表示输入层的激活值,那么第  层的激活值更通用的表示就是a(l),而第 +1层的激活值a(l + 1)就可以由以下方式计算得到:
+
【一审】我们将这种步骤叫作'''前向传导'''。回想一下,之前我们也用<math>a^{(1)} = x</math> 表示输入层的激活值,那么第<math>l</math>层的激活值更通用的表示就是<math>a^{(l)}</math>,而第<math>l+1</math>层的激活值<math>a^{(l+1)}</math> 就可以由以下方式计算得到:
 +
 
 +
:<math>\begin{align}
 +
z^{(l+1)} &= W^{(l)} a^{(l)} + b^{(l)}  \\
 +
a^{(l+1)} &= f(z^{(l+1)})
 +
\end{align}</math>
 +
 
 +
【二审】我们将这种步骤叫作'''正向传播'''。回想一下,之前我们也用<math>a^{(1)} = x</math> 表示输入层的激活值,那么第<math>l</math>层的激活值更通用的表示就是<math>a^{(l)}</math>,而第<math>l+1</math>层的激活值<math>a^{(l+1)}</math> 就可以由以下方式计算得到:
 +
 
 +
:<math>\begin{align}
 +
z^{(l+1)} &= W^{(l)} a^{(l)} + b^{(l)}  \\
 +
a^{(l+1)} &= f(z^{(l+1)})
 +
\end{align}</math>
【原文】By organizing our parameters in matrices and using matrix-vector operations, we can take advantage of fast linear algebra routines to quickly perform calculations in our network.  
【原文】By organizing our parameters in matrices and using matrix-vector operations, we can take advantage of fast linear algebra routines to quickly perform calculations in our network.  
Line 223: Line 270:
【二审】将参数矩阵化,使用矩阵-向量运算,我们就可以利用线性代数的优势对神经网络进行快速地求解。
【二审】将参数矩阵化,使用矩阵-向量运算,我们就可以利用线性代数的优势对神经网络进行快速地求解。
-
【原文】We have so far focused on one example neural network, but one can also build neural networks with other architectures (meaning patterns of connectivity between neurons), including ones with multiple hidden layers. The most common choice is a -layered network where layer is the input layer, layer is the output layer, and each layer is densely connected to layer . In this setting, to compute the output of the network, we can successively compute all the activations in layer , then layer , and so on, up to layer , using the equations above that describe the forward propagation step. This is one example of a feedforward neural network, since the connectivity graph does not have any directed loops or cycles.  
+
【原文】We have so far focused on one example neural network, but one can also build neural networks with other '''architectures''' (meaning patterns of connectivity between neurons), including ones with multiple hidden layers.The most common choice is a <math>\textstyle n_l</math>-layered network where layer <math>\textstyle 1</math> is the input layer, layer <math>\textstyle n_l</math> is the output layer, and each layer <math>\textstyle l</math> is densely connected to layer <math>\textstyle l+1</math>. In this setting, to compute the output of the network, we can successively compute all the activations in layer <math>\textstyle L_2</math>, then layer <math>\textstyle L_3</math>, and so on, up to layer <math>\textstyle L_{n_l}</math>, using the equations above that describe the forward propagation step. This is one example of a '''feedforward''' neural network, since the connectivity graph does not have any directed loops or cycles.
-
【初译】目前为止我们着重描述了一个神经网络的例子,但是你也可以设计其他结构的神经网络(神经元之间连接模式不同),也可以设计包含多个隐层的神经网络。最常见的是层网络,l为输入层,层为输出层,每个层l密集的连接到层l+1.在这种设计中,为了计算网络的输出,我们可以逐步计算每层的激活值,层,层,最后为层。利用上面我们提及的正向传播步骤。这是一个前馈神经网络例子,因为神经元之间彼此连接不构成任何直接闭环或回路。
+
【初译】目前为止我们着重描述了一个神经网络的例子,但是你也可以设计其他'''结构'''的神经网络(神经元之间连接模式不同),也可以设计包含多个隐层的神经网络。最常见的是<math>\textstyle n_l</math>层网络,<math>\textstyle 1</math>为输入层,层<math>\textstyle n_l</math>为输出层,每个层<math>\textstyle l</math>密集的连接到层<math>\textstyle l+1</math>.在这种设计中,为了计算网络的输出,我们可以逐步计算每层的激活值,层<math>\textstyle L_2</math>,层<math>\textstyle L_3</math>,最后为<math>\textstyle L_{n_l}</math>层。利用上面我们提及的正向传播步骤。这是一个'''前馈'''神经网络例子,因为神经元之间彼此连接不构成任何直接闭环或回路。
-
【一审】目前为止,我们讨论了一种神经网络的例子,但我们也可以构建一个另一种“结构”(这里结构指的是神经元之间的联接模式)的神经网络,包括具有多个隐藏层的神经网络。最常见的一种例子是层的神经网络,第1层是输入层,第层是输出层,中间的每个  层与层紧密相联。这种模式下,要计算神经网络的输出结果,我们可以通过之前的等式描述的那样,按部就班,进行前向传导,逐一计算第层的所有激活值,再者是第层的激活值,以此类推,直到第层。这是一个“前向传导”神经网络的样例,因为这种联接图并没有闭环或回路。
+
【一审】目前为止,我们讨论了一种神经网络的例子,但我们也可以构建一个另一种'''结构'''(这里结构指的是神经元之间的联接模式)的神经网络,包括具有多个隐藏层的神经网络。最常见的一种例子是<math>\textstyle n_l</math>层的神经网络,第<math>\textstyle 1</math>层是输入层,第<math>\textstyle n_l</math>层是输出层,中间的每个层<math>\textstyle l</math> 与层<math>\textstyle l+1</math>紧密相联。这种模式下,要计算神经网络的输出结果,我们可以通过之前的等式描述的那样,按部就班,进行前向传导,逐一计算第<math>\textstyle L_2</math>层的所有激活值,再者是第<math>\textstyle L_3</math>层的激活值,以此类推,直到第<math>\textstyle L_{n_l}</math>层。这是一个'''前向传导'''神经网络的样例,因为这种联接图并没有闭环或回路。
-
【二审】目前为止,我们讨论了一种神经网络的例子,但我们也可以构建一个另一种“结构”的神经网络(这里结构指的是神经元之间的联接模式),包括具有多个隐藏层的神经网络。最常见的一个例子是层的神经网络,第1层是输入层,第层是输出层,中间的每个  层与层紧密相联。这种模式下,要计算神经网络的输出结果,我们可以通过之前的等式描述的那样,按部就班,进行正向传播,逐一计算第层的所有激活值,再者是第层的激活值,以此类推,直到第层。这是一个“前馈”神经网络的样例,因为这种联接图并没有闭环或回路。
+
【二审】目前为止,我们讨论了一种神经网络的例子,但我们也可以构建一个另一种'''结构'''的神经网络(这里结构指的是神经元之间的联接模式),包括具有多个隐藏层的神经网络。最常见的一个例子是<math>\textstyle n_l</math>层的神经网络,第<math>\textstyle 1</math>层是输入层,第<math>\textstyle n_l</math>层是输出层,中间的每个层<math>\textstyle l</math>与层<math>\textstyle l+1</math>紧密相联。这种模式下,要计算神经网络的输出结果,我们可以通过之前的等式描述的那样,按部就班,进行正向传播,逐一计算第<math>\textstyle L_2</math>层的所有激活值,再者是第<math>\textstyle L_3</math>层的激活值,以此类推,直到第<math>\textstyle L_{n_l}</math>层。这是一个'''前馈'''神经网络的样例,因为这种联接图并没有闭环或回路。
-
【原文】Neural networks can also have multiple output units. For example, here is a network with two hidden layers layers L2 and L3 and two output units in layer L4:
+
【原文】Neural networks can also have multiple output units. For example, here is a network with two hidden layers layers <math>L_2</math> and <math>L_3</math> and two output units in layer <math>L_4</math>:
 +
 
 +
[[Image:Network3322.png|500px|center]]
   
   
-
【初译】神经网络也可以有多个输出节点。例如,这是一个神经网络有两个隐层L2 L3 ,层L4有两个输出节点。
+
【初译】神经网络也可以有多个输出节点。例如,这是一个神经网络有两个隐层<math>L_2</math> 和<math>L_3</math> ,层<math>L_4</math>有两个输出节点。
 +
 
 +
【一审】神经网络也可以有多个输出单元。比如,以下神经网络有两层隐藏层:<math>L_2</math> 及<math>L_3</math>,并在<math>L_4</math>层中有两个输出单元。
 +
 
 +
【二审】神经网络也可以有多个输出单元。比如,以下神经网络有两层隐藏层:<math>L_2</math> 及<math>L_3</math>,并在<math>L_4</math>层中有两个输出单元。
 +
 
 +
【原文】To train this network, we would need training examples <math>(x^{(i)}, y^{(i)})</math> where <math>y^{(i)} \in \Re^2</math>.  This sort of network is useful if there're multiple outputs that you're interested in predicting.  (For example, in a medical diagnosis application, the vector <math>x</math> might give the input features of a patient, and the different outputs <math>y_i</math>'s might indicate presence or absence of different diseases.)
-
【一审】神经网络也可以有多个输出单元。比如,以下神经网络有两层隐藏层:L2 及L3,并在L4层中有两个输出单元。
 
-
【二审】神经网络也可以有多个输出单元。比如,以下神经网络有两层隐藏层:L2 及L3,并在L4层中有两个输出单元。
+
{{Sparse_Autoencoder}}
-
【原文】To train this network, we would need training examples (x(i),y(i)) where . This sort of network is useful if there're multiple outputs that you're interested in predicting. (For example, in a medical diagnosis application, the vector x might give the input features of a patient, and the different outputs yi's might indicate presence or absence of different diseases.)
 
-
【初译】为了训练网络,我们需要训练样本(x(i),y(i)),其中。当你想用于预测时,多个输出的网络更为有用。(例如,在医学诊断应用中,向量x表示病人情况,不同输出yi表示不同疾病的存在或者不存在。)
+
【初译】为了训练网络,我们需要训练样本 <math>(x^{(i)}, y^{(i)})</math> ,其中<math>y^{(i)} \in \Re^2</math>。当你想用于预测时,多个输出的网络更为有用。(例如,在医学诊断应用中,向量<math>x</math> 表示病人情况,不同输出<math>y_i</math>表示不同疾病的存在或者不存在。)
-
【一审】要求解这样的神经网络,我们就需要样本集(x(i),y(i)),其中。如果你想预测的输出是多个的,那这种神经网络是很适用的。(比如,在医疗诊断应用中,患者的体征指标就可以作为向量的输入值,而不同的输出值yi就可以表示不同的疾病存在与否。)
+
【一审】要求解这样的神经网络,我们就需要样本集 <math>(x^{(i)}, y^{(i)})</math> ,其中<math>y^{(i)} \in \Re^2</math>。如果你想预测的输出是多个的,那这种神经网络是很适用的。(比如,在医疗诊断应用中,患者的体征指标就可以作为向量的输入值,而不同的输出值<math>y_i</math>就可以表示不同的疾病存在与否。)
-
【二审】要求解这样的神经网络,我们就需要样本集(x(i),y(i)),其中。如果你想预测的输出是多个的,那这种神经网络是很适用的。(比如,在医疗诊断应用中,患者的体征指标就可以作为向量的输入值,而不同的输出值yi就可以表示不同的疾病存在与否。)
+
【二审】要求解这样的神经网络,我们就需要样本集 <math>(x^{(i)}, y^{(i)})</math> ,其中<math>y^{(i)} \in \Re^2</math>。如果你想预测的输出是多个的,那这种神经网络是很适用的。(比如,在医疗诊断应用中,患者的体征指标就可以作为向量的输入值,而不同的输出值<math>y_i</math>就可以表示不同的疾病存在与否。)

Revision as of 07:33, 9 March 2013

Personal tools