自编码算法与稀疏性

From Ufldl

Jump to: navigation, search
Line 218: Line 218:
其中 <math>\textstyle {\rm KL}(\rho || \hat\rho_j)
其中 <math>\textstyle {\rm KL}(\rho || \hat\rho_j)
  = \rho \log \frac{\rho}{\hat\rho_j} + (1-\rho) \log \frac{1-\rho}{1-\hat\rho_j}</math> 是一个以 <math>\textstyle \rho</math> 为均值和一个以 <math>\textstyle \hat\rho_j</math> 为均值的两个伯努利随机变量之间的相对熵。相对熵是一种标准的用来测量两个分布之间差异的方法。(如果你没有见过相对熵,不用担心,所有你需要知道的内容都会被包含在这份笔记之中。)
  = \rho \log \frac{\rho}{\hat\rho_j} + (1-\rho) \log \frac{1-\rho}{1-\hat\rho_j}</math> 是一个以 <math>\textstyle \rho</math> 为均值和一个以 <math>\textstyle \hat\rho_j</math> 为均值的两个伯努利随机变量之间的相对熵。相对熵是一种标准的用来测量两个分布之间差异的方法。(如果你没有见过相对熵,不用担心,所有你需要知道的内容都会被包含在这份笔记之中。)
 +
 +
【原文】
 +
 +
This penalty function has the property that <math>\textstyle {\rm KL}(\rho || \hat\rho_j) = 0</math> if <math>\textstyle \hat\rho_j = \rho</math>,
 +
and otherwise it increases monotonically as <math>\textstyle \hat\rho_j</math> diverges from <math>\textstyle \rho</math>.  For example, in the
 +
figure below, we have set <math>\textstyle \rho = 0.2</math>, and plotted
 +
<math>\textstyle {\rm KL}(\rho || \hat\rho_j)</math> for a range of values of <math>\textstyle \hat\rho_j</math>:
 +
 +
【初译】
 +
 +
这一惩罚因子有如下性质,当 <math>\textstyle \hat\rho_j = \rho</math> 时 <math>\textstyle {\rm KL}(\rho || \hat\rho_j) = 0</math> ,并且随着 <math>\textstyle \hat\rho_j</math> 与 <math>\textstyle \rho</math> 之间的差异增大而单调递增。举例来说,在下图中,我们设定 <math>\textstyle \rho = 0.2</math> 并且画出了随着 <math>\textstyle \hat\rho_j</math> 变化,相对熵值 <math>\textstyle {\rm KL}(\rho || \hat\rho_j)</math> 的变化。
 +
 +
【一审】
 +
 +
这个惩罚函数具有一种属性:即,如果 <math>\textstyle \hat\rho_j = \rho</math> ,则 <math>\textstyle {\rm KL}(\rho || \hat\rho_j) = 0</math> ,否则,随着 <math>\textstyle \hat\rho_j</math> 与 <math>\textstyle \rho</math> 之间差距变大,函数值相应单调递增。比如,如下图所示,我们设 <math>\textstyle {\rm KL}(\rho || \hat\rho_j)</math> ,在 <math>\textstyle \hat\rho_j</math> 的取值范围内,作出了函数 曲线图:
 +
 +
【二审】
 +
 +
这一惩罚因子有如下性质,当 <math>\textstyle \hat\rho_j = \rho</math> 时 <math>\textstyle {\rm KL}(\rho || \hat\rho_j) = 0</math> ,并且随着 <math>\textstyle \hat\rho_j</math> 与 <math>\textstyle \rho</math> 之间的差异增大而单调递增。举例来说,在下图中,我们设定 <math>\textstyle \rho = 0.2</math> 并且画出了相对熵值 <math>\textstyle {\rm KL}(\rho || \hat\rho_j)</math> 随着 <math>\textstyle \hat\rho_j</math> 变化的变化。
 +
 +
 +
我们可以看出,相对熵在 时达到它的最小值 ,而当 靠近0或者1的时候,相对熵则变得非常大(其实是趋向于正无穷)。所以,最小化这一惩罚因子具有使得 靠近 的效果。
 +
总体来说,我们的代价函数可以表示为
 +
 +
其中 如之前所定义,而 控制稀疏性惩罚因子的权重。 项则间接地取决于 和 ,因为它是隐藏神经元 的平均激活度,而隐层神经元的激活度取决于 和 。

Revision as of 13:46, 12 March 2013

Personal tools