神经网络向量化

From Ufldl

Jump to: navigation, search
Line 77: Line 77:
</math>
</math>
-
This forms a <math>s_2</math> by <math>m</math> matrix.
+
这就构成一个<math>s_2</math> X <math>m</math>的矩阵。它和<tt>W1 * x</tt>相加,就等于是把<tt>W1 * x</tt>矩阵(译者注:这里<tt>x</tt>是训练矩阵而非向量, 所以<tt>W1 * x</tt>代表两个矩阵相乘,结果还是一个矩阵)的每一列加上<tt>b1</tt>。如果不熟悉的话,可以参考Matlab/Octave的帮助文档获取更多信息(输入 “<tt>help repmat</tt>)<tt>rampat</tt>作为Matlab/Octave的内建函数,运行起来是相当高效的,远远快过我们自己用<tt>for</tt>循环实现的效果。
-
Thus, the result of adding this to <tt>W1 * x</tt> is that each column of the matrix gets <tt>b1</tt> added to it, as desired.
+
-
See Matlab/Octave's documentation (type "<tt>help repmat</tt>") for more information.  As a Matlab/Octave built-in function, <tt>repmat</tt> is very efficient as well, and runs much faster than if you were to implement the same thing yourself using a <tt>for</tt> loop.
+
-
 
+
现在我们来描述反向传播向量化的思路。在阅读这一节之前,强烈建议各位仔细阅读前面介绍的正向传播的例子代码,确保你已经完全理解。下边我们只会给出反向传播向量化实现的大致纲要,而由你来完成具体细节的推导(见[[矢量化编程]]的练习)。
-
'''初译:'''
+
-
这构成了一个<math>s_2</math>X<math>m</math>的矩阵。因此把它和<tt>W1 * x</tt>相加的结果就是把<tt>W1 * x</tt>这个矩阵的每一列加上<tt>b1</tt>。可以参照Matlab/Octave的文档获取更多信息(输入 “<tt>help repmat</tt>”)。做为Matlab/Octave的内建函数,<tt>rampat</tt>运行是非常高效的,运行速度远远快过我们自己用<tt>for</tt>循环实现。
+
-
 
+
-
'''一审:'''
+
-
这就构成一个<math>s_2</math>X<math>m</math>的矩阵(回忆前面s2是网络第二层中的神经元数—译者)。它和<tt>W1 * x</tt>相加,就等于是把<tt>W1 * x</tt>矩阵(注意这里<tt>x</tt>是训练矩阵而非向量, 所以<tt>W1 * x</tt>代表两个矩阵相乘,结果还是一个矩阵—译者)的每一列加上<tt>b1</tt>。如果不熟悉的话,可以参考Matlab/Octave的帮助文档获取更多信息(输入 “<tt>help repmat</tt>”)。<tt>rampat</tt>作为Matlab/Octave的内建函数,运行起来是相当高效的,远远快过我们自己用<tt>for</tt>循环实现的效果。
+
-
 
+
-
== Backpropagation ==
+
-
 
+
-
We now describe the main ideas behind vectorizing backpropagation.  Before reading this section, we strongly encourage you to carefully step through all the forward propagation code examples above to make sure you fully understand them.  In this text, we'll only sketch the details of how to vectorize backpropagation, and leave you to derive the details in the [[Exercise:Vectorization|Vectorization exercise]].
+
-
 
+
-
==反向传导==
+
-
 
+
-
'''初译:'''
+
-
现在我们来描述反向传导向量化的做法。在阅读这一节之前,强烈建议各位筒子仔细阅读前面介绍的正向传导的例子代码确保你已经完全理解。下边我们只会对反向传导向量化给出细节的纲要,由你来通过[[向量化练习]]进行细节的推导。
+
-
 
+
-
'''一审:'''
+
-
现在我们来描述反向传导向量化的做法。在阅读这一节之前,强烈建议各位筒子仔细阅读前面介绍的正向传导的例子代码,确保你已经完全理解。下边我们只会给出反向传导向量化实现大致纲要,而由你来完成具体细节的推导(见[[Vectorization exercise]]练习)。
+
We are in a supervised learning setting, so that we have a training set <math>\{ (x^{(1)}, y^{(1)}), \ldots, (x^{(m)}, y^{(m)}) \}</math> of <math>m</math> training examples.  (For the autoencoder, we simply set <math>y^{(i)} = x^{(i)}</math>, but our derivation here will consider this more general setting.)
We are in a supervised learning setting, so that we have a training set <math>\{ (x^{(1)}, y^{(1)}), \ldots, (x^{(m)}, y^{(m)}) \}</math> of <math>m</math> training examples.  (For the autoencoder, we simply set <math>y^{(i)} = x^{(i)}</math>, but our derivation here will consider this more general setting.)

Revision as of 01:54, 16 March 2013

Personal tools