神经网络

From Ufldl

Jump to: navigation, search
Line 100: Line 100:
【二审】<math>\tanh(z)</math> 函数是sigmoid函数的一种变体,它的取值范围为<math>[-1,1]</math>,而不是sigmoid函数的<math>[0,1]</math>。
【二审】<math>\tanh(z)</math> 函数是sigmoid函数的一种变体,它的取值范围为<math>[-1,1]</math>,而不是sigmoid函数的<math>[0,1]</math>。
-
【原文】Note that unlike some other venues (including the OpenClassroom videos, and parts of CS229), we are not using the convention here of <math>x_0=1</math>. Instead, the intercept term is handled separately by the parameter b.  
+
【原文】Note that unlike some other venues (including the OpenClassroom videos, and parts of CS229), we are not using the convention here of <math>x_0=1</math>. Instead, the intercept term is handled separately by the parameter <math>b</math>.  
【初译】不同于其他的情况(在开放性课程视频CS229中),我们不再令<math>x_0=1</math>。截距项通过参数<math>b</math>来单独处理。
【初译】不同于其他的情况(在开放性课程视频CS229中),我们不再令<math>x_0=1</math>。截距项通过参数<math>b</math>来单独处理。
Line 108: Line 108:
【二审】注意,与其它地方(包括一些公开课以及斯坦福大学CS229课程)不同的是,这里我们不再令<math>x_0=1</math>,而是通过一个单独的参数<math>b</math>来表示。
【二审】注意,与其它地方(包括一些公开课以及斯坦福大学CS229课程)不同的是,这里我们不再令<math>x_0=1</math>,而是通过一个单独的参数<math>b</math>来表示。
-
【原文】Finally, one identity that'll be useful later: If f(z) = 1 / (1 + exp( z)) is the sigmoid function, then its derivative is given by f'(z) = f(z)(1 f(z)). (If f is the tanh function, then its derivative is given by f'(z) = 1 (f(z))2.) You can derive this yourself using the definition of the sigmoid (or tanh) function.
+
【原文】Finally, one identity that'll be useful later: If <math>f(z) = 1/(1+\exp(-z))</math> is the sigmoid function, then its derivative is given by <math>f'(z) = f(z) (1-f(z))</math>. (If <math>f</math>  is the tanh function, then its derivative is given by <math>f'(z) = 1- (f(z))^2</math>.) You can derive this yourself using the definition of the sigmoid (or tanh) function.
   
   
-
【初译】最后,有一个恒等式很有用:如果f(z) = 1 / (1 + exp( z))为S型函数,那么它的导数为f'(z) = f(z)(1 f(z))。(如果f为双曲正切函数,那么导数为f'(z) = 1 (f(z))2))。上式可以通过S型(双曲正切)函数的定义自行推导。
+
【初译】最后,有一个恒等式很有用:如果<math>f(z) = 1/(1+\exp(-z))</math>为S型函数,那么它的导数为<math>f'(z) = f(z) (1-f(z))</math>。(如果<math>f</math>为双曲正切函数,那么导数为<math>f'(z) = 1- (f(z))^2</math>.)。上式可以通过S型(双曲正切)函数的定义自行推导。
-
【一审】最后,有一个等式之后会经常用到:如果sigmoid函数是f(z) = 1 / (1 + exp( z)),那么它的导数就是f'(z) = f(z)(1 f(z))(如果f是双曲正切函数,那它的导数就是f'(z) = 1 (f(z))2),你可以根据sigmoid(或双曲正切)函数的定义自行推导这个等式。
+
【一审】最后,有一个等式之后会经常用到:如果sigmoid函数是<math>f(z) = 1/(1+\exp(-z))</math>,那么它的导数就是<math>f'(z) = f(z) (1-f(z))</math>(如果<math>f</math>是双曲正切函数,那它的导数就是<math>f'(z) = 1- (f(z))^2</math>.),你可以根据sigmoid(或双曲正切)函数的定义自行推导这个等式。
-
【二审】最后,有一个等式之后会经常用到:如果选择f(z) = 1 / (1 + exp( z)),也就是sigmoid函数,那么它的导数就是f'(z) = f(z)(1 f(z))(如果选择tanh函数,那它的导数就是f'(z) = 1 (f(z))2),你可以根据sigmoid(或tanh)函数的定义自行推导这个等式。
+
【二审】最后,有一个等式之后会经常用到:如果选择<math>f(z) = 1/(1+\exp(-z))</math>,也就是sigmoid函数,那么它的导数就是<math>f'(z) = f(z) (1-f(z))</math>(如果选择tanh函数,那它的导数就是<math>f'(z) = 1- (f(z))^2</math>.),你可以根据sigmoid(或tanh)函数的定义自行推导这个等式。
-
Neural Network model  
+
 
 +
== Neural Network model ==
神经网络模型
神经网络模型
【原文】A neural network is put together by hooking together many of our simple "neurons," so that the output of a neuron can be the input of another. For example, here is a small neural network:  
【原文】A neural network is put together by hooking together many of our simple "neurons," so that the output of a neuron can be the input of another. For example, here is a small neural network:  
 +
 +
[[Image:Network331.png|400px|center]]
【初译】神经网络就是很多个简单神经元的连接,一个神经元的输出可以是另一个神经元的输入。例如,下面是一个小的神经网络:
【初译】神经网络就是很多个简单神经元的连接,一个神经元的输出可以是另一个神经元的输入。例如,下面是一个小的神经网络:
Line 127: Line 130:
【二审】神经网络就是将许多个单一“神经元”联结在一起,这样,一个“神经元”的输出就可能是另一个“神经元”的输入。例如,下图是一个简单的神经网络:
【二审】神经网络就是将许多个单一“神经元”联结在一起,这样,一个“神经元”的输出就可能是另一个“神经元”的输入。例如,下图是一个简单的神经网络:
-
【原文】In this figure, we have used circles to also denote the inputs to the network. The circles labeled "+1" are called bias units, and correspond to the intercept term. The leftmost layer of the network is called the input layer, and the rightmost layer the output layer (which, in this example, has only one node). The middle layer of nodes is called the hidden layer, because its values are not observed in the training set. We also say that our example neural network has 3 input units (not counting the bias unit), 3 hidden units, and 1 output unit.  
+
【原文】In this figure, we have used circles to also denote the inputs to the network. The circles labeled "+1" are called '''bias units''', and correspond to the intercept term.The leftmost layer of the network is called the '''input layer''', and the rightmost layer the '''output layer''' (which, in this example, has only one
 +
node). The middle layer of nodes is called the '''hidden layer''', because its values are not observed in the training set. We also say that our example neural network has 3 '''input units''' (not counting the bias unit), 3 '''hidden units''', and 1 '''output unit'''.
-
【初译】在这个图中,我们用圆圈表示神经网络的输入。带有"+1"被称为偏置节点,对应着截距项。神经网络最左边的层被称为输入层,最右边的层被称为输出层(在这个例子中,只有一个节点)。中间层也称为隐层,因为它的值不能在训练样本中看到。我们的神经网络例子有3个输出节点(不包含偏置节点),3个隐层节点和1个输出节点。
+
【初译】在这个图中,我们用圆圈表示神经网络的输入。带有"+1"被称为'''偏置节点''',对应着截距项。神经网络最左边的层被称为'''输入层''',最右边的层被称为'''输出层'''(在这个例子中,只有一个节点)。中间层也称为'''隐层''',因为它的值不能在训练样本中看到。我们的神经网络例子有3个'''输入节点'''(不包含偏置节点),3个'''隐层节点'''和1个'''输出节点'''。
-
【一审】如图,我们使用圆圈来表示神经网络的输入,被标上“+1”的圆圈称为“偏置单元”,也就是截距项。神经网络最左边的一层叫做“输入层”,最右的一层叫做“输出层”(本例中,这层只有一个节点)。中间所有节点组成的一层叫做“隐藏层”,因为在样本集中并没有它的值。也可以说,以上神经网络的例子有3个“输入单元”(偏置单元不计在内),3个“隐藏单元”以及一个“输出单元”。
+
【一审】如图,我们使用圆圈来表示神经网络的输入,被标上“+1”的圆圈称为'''偏置单元''',也就是截距项。神经网络最左边的一层叫做'''输入层''',最右的一层叫做'''输出层'''(本例中,这层只有一个节点)。中间所有节点组成的一层叫做'''隐藏层''',因为在样本集中并没有它的值。也可以说,以上神经网络的例子有3个'''输入单元'''(偏置单元不计在内),3个'''隐藏单元'''以及一个'''输出单元'''。
-
【二审】如图,我们使用圆圈来表示神经网络的输入,被标上“+1”的圆圈称为“偏置单元”,也就是截距项。神经网络最左边的一层叫做“输入层”,最右的一层叫做“输出层”(本例中,输出层只有一个节点)。中间所有节点组成的一层叫做“隐藏层”,因为我们不能在训练集中观测到它们的值。同时可以看到,以上神经网络的例子有3个“输入单元”(偏置单元不计在内),3个“隐藏单元”以及一个“输出单元”。
+
【二审】如图,我们使用圆圈来表示神经网络的输入,被标上“+1”的圆圈称为'''偏置单元''',也就是截距项。神经网络最左边的一层叫做'''输入层''',最右的一层叫做'''输出层'''(本例中,输出层只有一个节点)。中间所有节点组成的一层叫做'''隐藏层''',因为我们不能在训练集中观测到它们的值。同时可以看到,以上神经网络的例子有3个'''输入单元'''(偏置单元不计在内),3个'''隐藏单元'''以及一个'''输出单元'''。
-
【原文】We will let nl denote the number of layers in our network; thus nl = 3 in our example. We label layer as Ll, so layer L1 is the input layer, and layer the output layer. Our neural network has parameters (W,b) = (W(1),b(1),W(2),b(2)), where we write to denote the parameter (or weight) associated with the connection between unit j in layer , and unit i in layer + 1. (Note the order of the indices.) Also, is the bias associated with unit i in layer + 1. Thus, in our example, we have , and . Note that bias units don't have inputs or connections going into them, since they always output the value +1. We also let sl denote the number of nodes in layer (not counting the bias unit).  
+
【原文】We will let <math>n_l</math>denote the number of layers in our network; thus <math>n_l=3</math> in our example. We label layer <math>l</math> as <math>L_l</math>, so layer <math>L_1</math> is the input layer, and layer <math>L_{n_l}</math> the output layer.
 +
Our neural network has parameters <math>(W,b) = (W^{(1)}, b^{(1)}, W^{(2)}, b^{(2)})</math>, where we write <math>W^{(l)}_{ij}</math> to denote the parameter (or weight) associated with the connection between unit <math>j</math> in layer <math>l</math>, and unit <math>i</math> in layer <math>l+1</math>. (Note the order of the indices.)Also, <math>b^{(l)}_i</math> is the bias associated with unit <math>i</math> in layer <math>l+1</math>.Thus, in our example, we have <math>W^{(1)} \in \Re^{3\times 3}</math>, and <math>W^{(2)} \in \Re^{1\times 3}</math>.Note that bias units don't have inputs or connections going into them, since they always output
 +
the value +1. We also let <math>s_l</math> denote the number of nodes in layer <math>l</math> (not counting the bias unit).
-
【初译】标记为网络的层数;这样。标记层1为,这样层为输入层,层为输出层。神经网络参数,参数(或权重)表示层l节点j和层l+ 1节点i之间连接关系(注意角标的顺序。)表示层l+ 1节点i与偏置节点之间的连接关系。这样,在我们的例子中,和。注意到偏置节点没有输入和连接,所以输出总是为值+1。我们标记为层l的节点数目(不包含偏置节点数)。
+
【初译】标记<math>n_l</math>为网络的层数;这样<math>n_l=3</math>。标记层<math>l</math>为<math>L_l</math>,这样层<math>L_l</math>为输入层,层<math>L_{n_l}</math> 为输出层。神经网络参数,参数<math>(W,b) = (W^{(1)}, b^{(1)}, W^{(2)}, b^{(2)})</math>(或权重)<math>W^{(l)}_{ij}</math>表示层<math>l</math>节点<math>j</math>和层<math>l+1</math>节点<math>i</math>之间连接关系(注意角标的顺序。)<math>b^{(l)}_i</math>表示层l+ 1节点i与偏置节点之间的连接关系。这样,在我们的例子中,和。注意到偏置节点没有输入和连接,所以输出总是为值+1。我们标记为层l的节点数目(不包含偏置节点数)。
-
【一审】我们用nl表示网络的层数,因此,本例中nl=3,将第 层记为Ll,于是Ll就是输入层,输出层记为。本例神经网络有参数(W,b) = (W(1),b(1),W(2),b(2)),这里第 层第j单元与第 +1层第i单元之间联接的参数就用来表示(注意标号顺序)。同样,是第 + 1层第i单元的偏置项。(二审注:这里有点问题)因此,本例中,,。注意,偏置单元并没有输入值或与其它单元反向相联,这是因为它们总是只有一个输出值+1。同时,我们用sl表示第 层的节点数(偏置单元不计在内)。
+
【一审】我们用<math>n_l</math>表示网络的层数,因此,本例中<math>n_l=3</math>,将第<math>l</math>层记为<math>L_l</math>,于是<math>L_l</math>就是输入层,输出层记为<math>L_{n_l}</math>。本例神经网络有参数<math>(W,b) = (W^{(1)}, b^{(1)}, W^{(2)}, b^{(2)})</math>,这里第<math>l</math>层第<math>j</math>单元与第<math>l+1</math>层第<math>i</math>单元之间联接的参数就用<math>W^{(l)}_{ij}</math>来表示(注意标号顺序)。同样,<math>b^{(l)}_i</math>是第 + 1层第<math>i</math>单元的偏置项。(二审注:这里有点问题)因此,本例中,,。注意,偏置单元并没有输入值或与其它单元反向相联,这是因为它们总是只有一个输出值+1。同时,我们用sl表示第 层的节点数(偏置单元不计在内)。
-
【二审】我们用nl表示网络的层数,因此,本例中nl=3,将第 层记为L,于是Ll就是输入层,输出层记为。本例神经网络的参数(W,b) = (W(1),b(1),W(2),b(2)),其中第 层第j号单元与第 +1层第i号单元之间联接的参数(注意标号顺序),是第层的偏置项与 + 1层的第i号单元之间的参数。因此,本例中,,。注意,没有其他单元员连向偏置单元(也就是偏置单元没有输入),因为它们总是输出+1。同时,我们用sl表示第 层的节点数(偏置单元不计在内)。
+
【二审】我们用<math>n_l</math>表示网络的层数,因此,本例中<math>n_l=3</math>,将第<math>l</math>层记为<math>L_l</math>,于是<math>L_l</math>就是输入层,输出层记为<math>L_{n_l}</math>。本例神经网络的参数<math>(W,b) = (W^{(1)}, b^{(1)}, W^{(2)}, b^{(2)})</math>,其中<math>W^{(l)}_{ij}</math>第<math>l</math>层第<math>j</math>号单元与第<math>l+1</math>层第<math>i</math>号单元之间联接的参数(注意标号顺序),<math>b^{(l)}_i</math>是第层的偏置项与 + 1层的第i号单元之间的参数。因此,本例中,,。注意,没有其他单元员连向偏置单元(也就是偏置单元没有输入),因为它们总是输出+1。同时,我们用sl表示第 层的节点数(偏置单元不计在内)。
【原文】We will write to denote the activation (meaning output value) of unit i in layer . For = 1, we also use to denote the i-th input. Given a fixed setting of the parameters W,b, our neural network defines a hypothesis hW,b(x) that outputs a real number. Specifically, the computation that this neural network represents is given by:  
【原文】We will write to denote the activation (meaning output value) of unit i in layer . For = 1, we also use to denote the i-th input. Given a fixed setting of the parameters W,b, our neural network defines a hypothesis hW,b(x) that outputs a real number. Specifically, the computation that this neural network represents is given by:  

Revision as of 13:53, 8 March 2013

Personal tools