线性解码器
From Ufldl
Line 1: | Line 1: | ||
- | + | == 稀疏自编码重述 == | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | == | + | |
稀疏自编码器包含3层神经元,分别是输入层,隐含层以及输出层。 | 稀疏自编码器包含3层神经元,分别是输入层,隐含层以及输出层。 | ||
Line 23: | Line 15: | ||
</math> | </math> | ||
- | 其中 <math>a^{(3)}</math> 是输出. 在自编码器中, <math>a^{(3)}</math> 近似重构了输入<math>x = a^{(1)}</math>。 | + | 其中 <math>a^{(3)}</math> 是输出. 在自编码器中, <math>a^{(3)}</math> 近似重构了输入 <math>x = a^{(1)}</math>。 |
- | + | S 型激励函数输出范围是 <math>[0,1]</math>,当 <math>f(z^{(3)})</math> 采用该激励函数时,就要对输入限制或缩放,使其位于 <math>[0,1]</math> 范围中。一些数据集,比如 MNIST,能方便将输出缩放到 [0,1] 中,但是很难满足对输入值的要求。比如, PCA 白化处理的输入并不满足 <math>[0,1]</math> 范围要求,也不清楚是否有最好的办法可以将数据缩放到特定范围中。 | |
- | |||
+ | == 线性解码器 == | ||
- | 设定<math>a^{(3)} = z^{(3)}</math>可以很简单的解决上述问题。从形式上来看,就是输出端使用恒等函数<math>f(z) = z</math>作为激励函数,于是有<math>a^{(3)} = f(z^{(3)}) = z^{(3)}</math>。我们称该特殊的激励函数为 '''线性激励函数 '''(称为恒等激励函数可能更好些)。 | + | 设定 <math>a^{(3)} = z^{(3)}</math> 可以很简单的解决上述问题。从形式上来看,就是输出端使用恒等函数 <math>f(z) = z</math> 作为激励函数,于是有 <math>a^{(3)} = f(z^{(3)}) = z^{(3)}</math>。我们称该特殊的激励函数为 '''线性激励函数 '''(称为恒等激励函数可能更好些)。 |
- | + | ||
+ | 需要注意,神经网络中隐含层的神经元依然使用S型(或者tanh)激励函数。这样隐含单元的激励公式为 <math>\textstyle a^{(2)} = \sigma(W^{(1)}x + b^{(1)})</math> ,其中 <math>\sigma(\cdot)</math> 是 S 型函数, <math>x</math> 是输入, <math>W^{(1)}</math> 和 <math>b^{(1)}</math> 分别是隐单元的权重和偏差项。我们仅在输出层中使用线性激励函数。 | ||
- | + | 一个 S 型或 tanh 隐含层以及线性输出层构成的自编码器,我们称为'''线性解码器'''。 | |
- | + | ||
+ | 在这个线性解码器模型中,<math>\hat{x} = a^{(3)} = z^{(3)} = W^{(2)}a + b^{(2)}</math>。因为输出 <math>\hat{x} </math> 是隐单元激励输出的线性函数,改变 <math>W^{(2)}</math> ,可以使输出值 <math>a^{(3)}</math> 大于 1 或者小于 0。这使得我们可以用实值输入来训练稀疏自编码器,避免预先缩放样本到给定范围。 | ||
随着输出单元的激励函数的改变,这个输出单元梯度也相应变化。回顾之前每一个输出单元误差项定义为: | 随着输出单元的激励函数的改变,这个输出单元梯度也相应变化。回顾之前每一个输出单元误差项定义为: | ||
Line 48: | Line 40: | ||
</math> | </math> | ||
- | 其中 <math>y = x</math>是所期望的输出, <math>\hat{x}</math> 是自编码器的输出, <math>f(\cdot)</math> 是激励函数.因为在输出层激励函数为<math>f(z) = z</math>, 这样 <math>f'(z) = 1</math>,所以上述公式可以简化为 | + | 其中 <math>y = x</math> 是所期望的输出, <math>\hat{x}</math> 是自编码器的输出, <math>f(\cdot)</math> 是激励函数.因为在输出层激励函数为 <math>f(z) = z</math>, 这样 <math>f'(z) = 1</math>,所以上述公式可以简化为 |
:<math> | :<math> | ||
\begin{align} | \begin{align} | ||
Line 58: | Line 50: | ||
当然,若使用反向传播算法来计算隐含层的误差项时: | 当然,若使用反向传播算法来计算隐含层的误差项时: | ||
- | <math> | + | :<math> |
\begin{align} | \begin{align} | ||
\delta^{(2)} &= \left( (W^{(2)})^T\delta^{(3)}\right) \bullet f'(z^{(2)}) | \delta^{(2)} &= \left( (W^{(2)})^T\delta^{(3)}\right) \bullet f'(z^{(2)}) | ||
Line 64: | Line 56: | ||
</math> | </math> | ||
- | + | 因为隐含层采用一个 S 型(或 tanh)的激励函数 <math>f</math>,在上述公式中,<math>f'(\cdot)</math> 依然是 S 型(或 tanh)函数的导数。 | |
+ | |||
+ | |||
+ | ==中英文对照== | ||
+ | |||
+ | :线性解码器 Linear Decoders | ||
+ | |||
+ | :稀疏自编码 Sparse Autoencoder | ||
+ | |||
+ | :输入层 input layer | ||
+ | |||
+ | :隐含层 hidden layer | ||
+ | |||
+ | :输出层 output layer | ||
+ | |||
+ | :神经元 neuron | ||
+ | |||
+ | :神经网络 neural network | ||
+ | |||
+ | :自编码器 autoencoder | ||
+ | |||
+ | :激励函数 activation function | ||
+ | |||
+ | :鲁棒 robust | ||
+ | |||
+ | :S型激励函数 sigmoid activation function | ||
+ | |||
+ | :tanh激励函数 tanh function | ||
+ | |||
+ | :线性激励函数 linear activation function | ||
+ | |||
+ | :恒等激励函数 identity activation function | ||
+ | |||
+ | :隐单元 hidden unit | ||
+ | |||
+ | :权重 weight | ||
+ | |||
+ | :偏差项 error term | ||
+ | |||
+ | :反向传播算法 backpropagation | ||
+ | |||
+ | |||
+ | |||
+ | ==中文译者== | ||
+ | |||
+ | 严晓东(yan.endless@gmail.com),姚涛(yaothinker@gmail.com),晓风(xiaofeng.zhb@alibaba-inc.com) | ||
+ | |||
+ | |||
+ | {{自编码线性解码器}} | ||
+ | |||
+ | |||
+ | {{Languages|Linear_Decoders|English}} |