神经网络向量化

From Ufldl

Jump to: navigation, search
Line 79: Line 79:
这就构成一个<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>循环实现的效果。
这就构成一个<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>循环实现的效果。
-
现在我们来描述反向传播向量化的思路。在阅读这一节之前,强烈建议各位仔细阅读前面介绍的正向传播的例子代码,确保你已经完全理解。下边我们只会给出反向传播向量化实现的大致纲要,而由你来完成具体细节的推导(见[[Exercise:Vectorization]])。
+
现在我们来描述反向传播向量化的思路。在阅读这一节之前,强烈建议各位仔细阅读前面介绍的正向传播的例子代码,确保你已经完全理解。下边我们只会给出反向传播向量化实现的大致纲要,而由你来完成具体细节的推导(见 [[Exercise:Vectorization]])。
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:56, 16 March 2013

Personal tools