自编码算法与稀疏性
From Ufldl
Line 207: | Line 207: | ||
【二审】 | 【二审】 | ||
+ | |||
+ | 为了实现这一限制,我们将会在我们的优化目标函数中加入一个额外的惩罚因子,而这一惩罚因子将惩罚那些 <math>\textstyle \hat\rho_j</math> 和 <math>\textstyle \rho</math> 有显著不同的情况从而使得隐藏神经元的平均活跃度保持在较小范围内。惩罚因子的具体形式有很多种合理的选择,我们将会选择以下这一种: | ||
+ | :<math>\begin{align} | ||
+ | \sum_{j=1}^{s_2} \rho \log \frac{\rho}{\hat\rho_j} + (1-\rho) \log \frac{1-\rho}{1-\hat\rho_j}. | ||
+ | \end{align}</math> | ||
+ | 这里, <math>\textstyle s_2</math> 是隐藏层中隐藏神经元的数量,而索引 <math>\textstyle j</math> 依次代表隐藏层中的每一个神经元。如果你对相对熵(KL divergence)比较熟悉,这一惩罚因子实际上是基于它的。于是惩罚因子也可以被表示为 | ||
+ | :<math>\begin{align} | ||
+ | \sum_{j=1}^{s_2} {\rm KL}(\rho || \hat\rho_j), | ||
+ | \end{align}</math> | ||
+ | 其中 <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> 为均值的两个伯努利随机变量之间的相对熵。相对熵是一种标准的用来测量两个分布之间差异的方法。(如果你没有见过相对熵,不用担心,所有你需要知道的内容都会被包含在这份笔记之中。) |