稀疏编码自编码表达

From Ufldl

Jump to: navigation, search
Line 60: Line 60:
理论上,通过上述迭代方法求解目标函数的最优化问题最终得到的特征集(A的基向量)与通过稀疏自编码学习得到的特征集是差不多的。但是实际上,为了获得更好的算法收敛性需要使用一些小技巧,后面的[[ Sparse Coding: Autoencoder Interpretation#稀疏编码实践| 稀疏编码实践]] 稀疏编码实践章节会详细介绍这些技巧。用梯度下降方法求解目标函数也略需技巧,另外使用矩阵演算或[[Deriving gradients using the backpropagation idea | 反向传播算法]]则有助于解决此类问题。  
理论上,通过上述迭代方法求解目标函数的最优化问题最终得到的特征集(A的基向量)与通过稀疏自编码学习得到的特征集是差不多的。但是实际上,为了获得更好的算法收敛性需要使用一些小技巧,后面的[[ Sparse Coding: Autoencoder Interpretation#稀疏编码实践| 稀疏编码实践]] 稀疏编码实践章节会详细介绍这些技巧。用梯度下降方法求解目标函数也略需技巧,另外使用矩阵演算或[[Deriving gradients using the backpropagation idea | 反向传播算法]]则有助于解决此类问题。  
-
In theory, optimizing for this objective function using the iterative method as above should (eventually) yield features (the basis vectors of <math>A</math>) similar to those learned using the sparse autoencoder. However, in practice, there are quite a few tricks required for better convergence of the algorithm, and these tricks are described in greater detail in the later section on [[ Sparse Coding: Autoencoder Interpretation#Sparse coding in practice | sparse coding in practice]]. Deriving the gradients for the objective function may be slightly tricky as well, and using matrix calculus or [[Deriving gradients using the backpropagation idea | using the backpropagation intuition]] can be helpful.
 
-
 
-
[初译]
 
-
 
-
理论上,通过上述迭代方法求解目标函数的最优化问题最终得到的特征集(基向量<math>A</math>)与通过稀疏编码学习得到的特征集类似。但是实际上,为了更好的获得算法收敛性需要使用一些小技巧,后面的稀疏编码实践章节会详细介绍这些技巧。用梯度下降方法求解目标函数略有技巧,此外使用矩阵演算以及反向传播机制也都有助于最优化问题的解决。
 
-
 
-
[一审]
 
-
 
-
理论上,通过上述迭代方法求解目标函数的最优化问题最终得到的特征集(<math>A</math>的基向量)与通过稀疏自编码学习得到的特征集是相似的。但是实际上,为了更好的获得算法收敛性需要使用一些小技巧,后面的稀疏编码实践章节会详细介绍这些技巧。用梯度下降方法求解目标函数略有技巧,此外使用矩阵演算以及反向传播机制也都有助于最优化问题的解决。
 
[原文]
[原文]
-
== Topographic sparse coding[拓扑稀疏编码] ==
+
== [拓扑稀疏编码] ==
-
With sparse coding, we can learn a set of features useful for representing the data. However, drawing inspiration from the brain, we would like to learn a set of features that are "orderly" in some manner. For instance, consider visual features. As suggested earlier, the V1 cortex of the brain contains neurons which detect edges at particular orientations. However, these neurons are also organized into hypercolumns in which adjacent neurons detect edges at similar orientations. One neuron could detect a horizontal edge, its neighbors edges oriented slightly off the horizontal, and moving further along the hypercolumn, the neurons detect edges oriented further off the horizontal.
+
通过稀疏编码,我们能够得到一组用于表示样本数据的特征集。不过,让我们来找些灵感,我们希望学习得到一组有某种“秩序”的特征集。举个例子,视觉特征,如前面所提到的,大脑皮层V1区神经元能够按特定的方向对边缘进行检测,同时,这些神经元(在生理上)被组织成超柱(hypercolumns),在超柱中,相邻神经元以相似的方向对边缘进行检测,一个神经元检测水平边缘,其相邻神经元检测到的边缘就稍微偏离水平方向,沿着超柱,神经元就可以检测到与水平方向相差更大的边缘了。
-
[初译]
+
受该例子的启发,我们希望学习到的特征也具有这样“拓扑秩序”的性质。这对于我们要学习的特征意味着什么呢?直观的讲,如果“相邻”的特征是“相似”的,就意味着如果某个特征被激活,那么与之相邻的特征也将随之被激活。
-
拓扑稀疏编码
+
具体而言,假设我们(随意地)将特征组织成一个方阵。我们就希望矩阵中相邻的特征是相似的。实现这一点的方法是将相邻特征按经过平滑的L1范式惩罚进行分组,如果按3x3方阵分组,则用<math>\sqrt{s_{1,1}^2 + s_{1,2}^2 + s_{1,3}^2 + s_{2,1}^2 + s_{2,2}^2 + s_{3,2}^2 + s_{3,1}^2 + s_{3,2}^2 + s_{3,3}^2 + \epsilon}</math>代替<math>\sqrt{s_{1,1}^2 + \epsilon}</math>, 其分组通常是重合的,因此从第1行第1列开始的3x3区域是一个分组,从第1行第2列开始的3x3区域是另一个分组,以此类推。最终,这样的分组会形成环绕,就好像这个矩阵是个环形曲面,所以每个特征都以同样的次数进行了分组。
-
 
+
于是,将经过平滑的所有分组的L1惩罚值之和代替经过平滑的L1惩罚值,得到新的目标函数如下:
-
通过稀疏编码,能够得到很多用于表示数据的特征。而且根据从大脑结构中获得的灵感,能够学习到一系列以某种方式“有序”组合在一起的特征。以视觉特征为例。如前面所提到的,V1区的大脑皮层神经元能够在特定方向进行边缘检测。同时,相邻的神经元能够在相同的方向进行边缘检测,因此它们被组织成超柱(hypercolumns)。单个神经元仅可以检测水平边缘,其相邻边缘稍微偏离检测到的水平边缘,但是由相邻神经元组成的超柱(hypercolumns)检测的边缘会极大的偏离单个神经元检测到的水平值。
+
-
 
+
-
[一审]
+
-
 
+
-
通过稀疏编码,能够得到一组用于表示数据的特征。而且根据从大脑结构中获得的灵感,我们希望学习到一组以某种方式“有序”组合在一起的特征。以视觉特征为例。如前面所提到的,大脑皮层V1区神经元能够在特定方向进行边缘检测。同时,这些神经元(在生理上)被组织成超柱(hypercolumns),使得相邻神经元完成相似方向的边缘检测。一个神经元可以检测水平边缘,其相邻边缘稍微偏离水平,并沿着超柱移动,那些神经元就可以检测方向与水平方向相差甚远的边缘了。
+
-
 
+
-
[原文]
+
-
 
+
-
Inspired by this example, we would like to learn features which are similarly "topographically ordered". What does this imply for our learned features? Intuitively, if "adjacent" features are "similar", we would expect that if one feature is activated, its neighbors will also be activated to a lesser extent.
+
-
 
+
-
[初译]
+
-
 
+
-
根据该例子的启发,我们对“拓扑有序”的特征感兴趣。这意味着我们要学习的特征是什么呢?直观的讲,如果“相邻”的特征是“相似”的,就意味着如果某个特征被激活,那么与之相邻的特征在较小的程度上被激活。
+
-
 
+
-
[一审]
+
-
 
+
-
受该例子的启发,我们希望学到的特征具有这样“拓扑有序”的性质。这对于我们要学习的特征意味着什么呢?直观的讲,如果“相邻”的特征是“相似”的,就意味着如果某个特征被激活,那么与之相邻的特征在较小的程度上也会被激活。
+
-
 
+
-
[原文]
+
-
 
+
-
Concretely, suppose we (arbitrarily) organized our features into a square matrix. We would then like adjacent features in the matrix to be similar. The way this is accomplished is to group these adjacent features together in the smoothed L1 penalty, so that instead of say <math>\sqrt{s_{1,1}^2 + \epsilon}</math>, we use say <math>\sqrt{s_{1,1}^2 + s_{1,2}^2 + s_{1,3}^2 + s_{2,1}^2 + s_{2,2}^2 + s_{3,2}^2 + s_{3,1}^2 + s_{3,2}^2 + s_{3,3}^2 + \epsilon}</math> instead, if we group in 3x3 regions. The grouping is usually overlapping, so that the 3x3 region starting at the 1st row and 1st column is one group, the 3x3 region starting at the 1st row and 2nd column is another group, and so on. Further, the grouping is also usually done wrapping around, as if the matrix were a torus, so that every feature is counted an equal number of times.
+
-
 
+
-
Hence, in place of the smoothed L1 penalty, we use the sum of smoothed L1 penalties over all the groups, so our new objective function is:
+
-
 
+
-
[初译]
+
-
 
+
-
具体而言,假设我们(随意地)将特征组织成一个方阵。矩阵中相邻特征是相似的。实现这一点的方法是将相邻特征按经过平滑的L1范数惩罚值进行分组,如果在3x3的区域内分组,则用 <math>\sqrt{s_{1,1}^2 + s_{1,2}^2 + s_{1,3}^2 + s_{2,1}^2 + s_{2,2}^2 + s_{3,2}^2 + s_{3,1}^2 + s_{3,2}^2 + s_{3,3}^2 + \epsilon}</math> 代替 <math>\sqrt{s_{1,1}^2 + \epsilon}</math>。其分组通常是重合的,因此从第1行第1列开始的3x3区域是一个分组,从第1行第2列开始的区域是另一个分组,以此类推。另外,因为矩阵是环形的,分组也通常是环绕进行,所以每个特征的计数是相等的。
+
-
 
+
-
用所有分组中经过平滑的L1惩罚值之和代替经过平滑的L1惩罚值,得到新的目标函数如下:
+
-
 
+
-
[一审]
+
-
 
+
-
具体而言,假设我们(随意地)将特征组织成一个方阵。我们就希望矩阵中相邻特征是相似的。实现这一点的方法是将相邻特征按经过平滑的L1范数惩罚值进行分组,如果在3x3的区域内分组,则用 <math>\sqrt{s_{1,1}^2 + s_{1,2}^2 + s_{1,3}^2 + s_{2,1}^2 + s_{2,2}^2 + s_{3,2}^2 + s_{3,1}^2 + s_{3,2}^2 + s_{3,3}^2 + \epsilon}</math> 代替<math>\sqrt{s_{1,1}^2 + \epsilon}</math> 。其分组通常是重合的,因此从第1行第1列开始的3x3区域是一个分组,从第1行第2列开始的区域是另一个分组,以此类推。另外,把矩阵当作围成的环形一样,分组也通常是环绕进行,所以每个特征的计数是相等的。
+
-
 
+
-
用所有分组中经过平滑的L1惩罚值之和代替经过平滑的L1惩罚值,得到新的目标函数如下:
+
-
 
+
-
[原文]
+
:<math>
:<math>
Line 122: Line 76:
</math>
</math>
-
[原文]
+
实际上,“分组”可以通过“分组矩阵”<math>V</math>完成,于是矩阵<math>V</math>的第<math>r</math>行标识了哪些特征被分到第<math>r</math>组中,即如果第<math>r</math>组包含特征<math>c</math>则<math>V_{r, c} = 1</math>。通过分组矩阵实现分组使得梯度的计算更加直观,使用此分组矩阵,目标函数被重写为:
-
 
+
-
In practice, the "grouping" can be accomplished using a "grouping matrix" <math>V</math>, such that the <math>r</math>th row of <math>V</math> indicates which features are grouped in the <math>r</math>th group, so <math>V_{r, c} = 1</math> if group <math>r</math> contains feature <math>c</math>. Thinking of the grouping as being achieved by a grouping matrix makes the computation of the gradients more intuitive. Using this grouping matrix, the objective function can be rewritten as:
+
-
 
+
-
[初译]
+
-
 
+
-
实际上,“分组”可以通过“分组矩阵”<math>V</math>完成,例如矩阵<math>V</math>的第<math>r</math>列表示特征被分到第<math>r</math>组中,即如果第<math>r</math>组包含特征<math>c</math>则<math>V_{r, c} = 1</math>。通过分组矩阵实现分组使得梯度的计算更加直观。使用此分组矩阵,目标函数被重写为:
+
-
 
+
-
[一审]
+
-
 
+
-
实际上,“分组”可以通过“分组矩阵”<math>V</math>完成,例如矩阵<math>V</math>的第<math>r</math>列记录哪些特征被分到第<math>r</math>组中,即如果第<math>r</math>组包含特征<math>c</math>则<math>V_{r, c} = 1</math>。通过分组矩阵实现分组使得梯度的计算更加直观。使用此分组矩阵,目标函数被重写为:
+
-
 
+
-
[原文]
+
:<math>
:<math>
J(A, s) = \lVert As - x \rVert_2^2 + \lambda \sum{ \sqrt{Vss^T + \epsilon} } + \gamma \lVert A \rVert_2^2
J(A, s) = \lVert As - x \rVert_2^2 + \lambda \sum{ \sqrt{Vss^T + \epsilon} } + \gamma \lVert A \rVert_2^2
</math>
</math>
-
 
-
(where <math>\sum{ \sqrt{Vss^T + \epsilon} }</math> is <math>\sum_r{ \sum_c { D_{r, c} } } </math> if we let <math>D = \sqrt{Vss^T + \epsilon}</math>)
 
-
 
-
[初译]
 
(令<math>D = \sqrt{Vss^T + \epsilon}</math>,<math>\sum{ \sqrt{Vss^T + \epsilon} }</math> 等价于 <math>\sum_r{ \sum_c { D_{r, c} } } </math>)
(令<math>D = \sqrt{Vss^T + \epsilon}</math>,<math>\sum{ \sqrt{Vss^T + \epsilon} }</math> 等价于 <math>\sum_r{ \sum_c { D_{r, c} } } </math>)
-
[一审]
+
该目标函数能够使用之前部分提到的迭代方法进行求解。拓扑稀疏编码得到的特征与稀疏编码得到的类似,只是拓扑稀疏编码得到的特征是以某种方式有“秩序”排列的。
-
(令<math>D = \sqrt{Vss^T + \epsilon}</math>,<math>\sum{ \sqrt{Vss^T + \epsilon} }</math> 等价于 <math>\sum_r{ \sum_c { D_{r, c} } } </math>)
+
== [稀疏编码实践] ==
-
[原文]
+
如上所述,虽然稀疏编码背后的理论十分简单,但是要写出准确无误的实现代码并能快速又恰到好处地收敛到最优值,则需要一定的技巧。
-
This objective function can be optimized using the iterated method described in the earlier section. Topographic sparse coding will learn features similar to those learned by sparse coding, except that the features will now be "ordered" in some way.
+
回顾一下之前提到的简单迭代算法:
-
 
+
-
[初译]
+
-
 
+
-
该目标函数能够使用之前部分提到的迭代方法进行求解。拓扑稀疏编码得到的特征与稀疏编码得到的类似,但是拓扑稀疏编码得到的特征是以某种方式“有序”的。
+
-
 
+
-
[一审]
+
-
 
+
-
该目标函数能够使用之前部分提到的迭代方法进行求解。拓扑稀疏编码得到的特征与稀疏编码得到的类似,但是拓扑稀疏编码得到的特征是以某种方式“有序”的。
+
-
 
+
-
[原文]
+
-
 
+
-
== Sparse coding in practice[稀疏编码实践] ==
+
-
 
+
-
As suggested in the earlier sections, while the theory behind sparse coding is quite simple, writing a good implementation that actually works and converges reasonably quickly to good optima requires a bit of finesse.
+
-
 
+
-
[初译]
+
-
 
+
-
如上所述,稀疏编码背后的理论十分简单,但是要实现一个好的稀疏编码算法需要一定的技巧。一个好的算法不仅能实际工作并且能够合理快速地收敛到最优值。
+
-
 
+
-
[一审]
+
-
 
+
-
如上所述,稀疏编码背后的理论十分简单,但是要实现一个好的稀疏编码算法需要一定的技巧。一个好的算法不仅能实际工作并且能够合理快速地收敛到最优值。
+
-
 
+
-
[原文]
+
-
 
+
-
Recall the simple iterative algorithm proposed earlier:
+
-
<ol>
+
-
<li>Initialize <math>A</math> randomly
+
-
<li>Repeat until convergence
+
-
  <ol>
+
-
    <li>Find the <math>s</math> that minimizes <math>J(A, s)</math> for the <math>A</math> found in the previous step
+
-
    <li>Solve for the <math>A</math> that minimizes <math>J(A, s)</math> for the <math>s</math> found in the previous step
+
-
  </ol>
+
-
</ol>
+
-
 
+
-
[初译]
+
-
 
+
-
调用之前提到的简单迭代算法:
+
<ol>
<ol>
<li>随机初始化<math>A</math>
<li>随机初始化<math>A</math>
-
<li>重复以下步骤直至收敛:
+
<li>重复以下步骤直至收敛到最优值:
   <ol>
   <ol>
     <li>根据上一步给定的<math>A</math>,求解能够最小化<math>J(A, s)</math>的<math>s</math>   
     <li>根据上一步给定的<math>A</math>,求解能够最小化<math>J(A, s)</math>的<math>s</math>   
Line 200: Line 100:
</ol>
</ol>
-
[一审]
+
这样信手拈来地执行这个算法,结果并不会令人满意,即使确实得到了某些结果。以下是两种更快更优化的收敛技巧:
-
 
+
-
调用之前提到的简单迭代算法:
+
-
<ol>
+
-
<li>随机初始化<math>A</math>
+
-
<li>重复以下步骤直至收敛:
+
-
  <ol>
+
-
    <li>根据上一步给定的<math>A</math>,求解能够最小化<math>J(A, s)</math>的<math>s</math> 
+
-
    <li>根据上一步得到的<math>s</math>,求解能够最小化<math>J(A, s)</math>的<math>A</math> 
+
-
  </ol>
+
-
</ol>
+
-
 
+
-
[原文]
+
-
 
+
-
It turns out that running this algorithm out of the box will not produce very good results, if any results are produced at all. There are two main tricks to achieve faster and better convergence:
+
-
<ol>
+
-
<li>Batching examples into "mini-batches"
+
-
<li>Good initialization of <math>s</math>
+
-
</ol>
+
-
 
+
-
[初译]
+
-
 
+
-
事实证明,即使有结果产生该算法的开箱即用也不会产生很好的效果。以下是两个快速收敛技巧:
+
<ol>
<ol>
-
<li>将样本处理为“迷你块”
+
<li>将样本分批为“迷你块”
<li>良好的<math>s</math>初始值
<li>良好的<math>s</math>初始值
</ol>
</ol>
-
[一审]
+
===  [将样本分批为“迷你块”]===
-
事实证明,即使有结果产生该算法的开箱即用也不会产生很好的效果。以下是两个快速收敛技巧:
+
如果你一次性在大规模数据集(比如,有10000 个patch)上执行简单的迭代算法,你会发现每次迭代都要花很长时间,也因此这算法要花好长时间才能达到收敛结果。为了提高收敛速度,可以选择在迷你块上运行该算法。每次迭代的时候,不是在所有的10000个patchs上执行该算法,而是使用迷你块,即从10000个patch中随机选出2000个patch,再在这个迷你块上执行这个算法。这样就可以做到一石二鸟――第一,提高了每次迭代的速度,因为现在每次迭代只在2000个patch上执行而不是10000个;第二,也是更重要的,它提高了收敛的速度(原因见TODO)。[[(TODO]]: explain why).
-
<ol>
+
-
<li>将样本处理为“迷你块”
+
-
<li>良好的<math>s</math>初始值
+
-
</ol>
+
-
[原文]
+
=== [良好的<math>s</math>初始值] ===
-
=== Batching examples into mini-batches [将样本处理为“迷你块”]===
+
另一个能获得更快速更优化收敛的重要技巧是:在给定<math>A</math>的条件下,根据目标函数使用梯度下降(或其他方法)求解<math>s</math>之前找到良好的特征矩阵<math>s</math>的初始值。实际上,除非在优化<math>A</math>的最优值前已找到一个最佳矩阵<math>s</math>,不然每次迭代过程中随机初始化<math>s</math>值会导致很差的收敛效果。下面给出一个初始化<math>s</math>的较好方法:  
-
 
+
-
If you try running the simple iterative algorithm on a large dataset of say 10 000 patches at one go, you will find that each iteration takes a long time, and the algorithm may hence take a long time to converge. To increase the rate of convergence, you can instead run the algorithm on mini-batches instead. To do this, instead of running the algorithm on all 10 000 patches, in each iteration, select a mini-batch - a (different) random subset of say 2000 patches from the 10 000 patches - and run the algorithm on that mini-batch for the iteration instead. This accomplishes two things - firstly, it speeds up each iteration, since now each iteration is operating on 2000 rather than 10 000 patches; secondly, and more importantly, it increases the rate of convergence [[(TODO]]: explain why).
+
-
 
+
-
[初译]
+
-
 
+
-
如果在一个大规模数据集(例如,10 000 patches)上运行上面描述的简单迭代算法,每次迭代都会耗费大量时间,因此算法收敛速度极慢。为了提高收敛速度,可以选择在迷你块上运行该算法。每次迭代中,选择一个迷你块代替10 000 patches 的大数据集合,然后在迷你块上运行算法。此处的迷你块是从10 000 patches中随机选取2000 patches。这样做有两点好处,一是加速了每次迭代,因为此时算法是在2000 patches而非10 000 patches上运行;更重要的是,加速了收敛速度。
+
-
 
+
-
[一审]
+
-
 
+
-
如果在一个大规模数据集(例如,10 000 patches)上运行上面描述的简单迭代算法,每次迭代都会耗费大量时间,因此算法收敛速度极慢。为了提高收敛速度,可以选择在迷你块上运行该算法。每次迭代中,选择一个迷你块代替10 000 patches 的大数据集合,然后在迷你块上运行算法。此处的迷你块是从10 000 patches中随机选取2000 patches。这样做有两点好处,一是加速了每次迭代,因为此时算法是在2000 patches而非10 000 patches上运行;更重要的是,加速了收敛速度。
+
-
 
+
-
[原文]
+
-
 
+
-
=== Good initialization of <math>s</math>[良好的<math>s</math>初始值] ===
+
-
 
+
-
Another important trick in obtaining faster and better convergence is good initialization of the feature matrix <math>s</math> before using gradient descent (or other methods) to optimize for the objective function for <math>s</math> given <math>A</math>. In practice, initializing <math>s</math> randomly at each iteration can result in poor convergence unless a good optima is found for <math>s</math> before moving on to optimize for <math>A</math>. A better way to initialize <math>s</math> is the following:
+
-
<ol>
+
-
<li>Set <math>s \leftarrow W^Tx</math> (where <math>x</math> is the matrix of patches in the mini-batch)
+
-
<li>For each feature in <math>s</math> (i.e. each column of <math>s</math>), divide the feature by the norm of the corresponding basis vector in <math>A</math>. That is, if <math>s_{r, c}</math> is the <math>r</math>th feature for the <math>c</math>th example, and <math>A_c</math> is the <math>c</math>th basis vector in <math>A</math>, then set <math>s_{r, c} \leftarrow \frac{ s_{r, c} } { \lVert A_c \rVert }.</math>
+
-
</ol>
+
-
 
+
-
[初译]
+
-
 
+
-
在给定<math>A</math>的条件下,根据目标函数使用梯度下降(或其他方法)求解<math>s</math>之前找到良好的特征矩阵<math>s</math>的初始值是另一个快速高效收敛的重要技巧。实际上,每次迭代过程<math>s</math>的随机初始化导致收敛性较差,除非在求解<math>A</math>的最优值前已得到<math>s</math>的最优解。下面给出一个初始化<math>s</math>的较好方法:
+
<ol>
<ol>
<li>令<math>s \leftarrow W^Tx</math> (<math>x</math> 是迷你块中patches的矩阵表示)
<li>令<math>s \leftarrow W^Tx</math> (<math>x</math> 是迷你块中patches的矩阵表示)
-
<li>对<math>s</math>做归一化处理:<math>s</math>中的每个特征(<math>s</math>的每一列)除以其在<math>A</math>中对应的偏移量。换句话说,如果 <math>s_{r, c}</math>表示<math>c</math>样本的第<math>r</math>个特征,<math>A_c</math>表示<math>A</math>中第<math>c</math>个偏移量,则令<math>s_{r, c} \leftarrow \frac{ s_{r, c} } { \lVert A_c \rVert }.</math>
+
<li><math>s</math>中的每个特征(<math>s</math>的每一列),除以其在<math>A</math>中对应基向量的范数。即,如果<math>s_{r, c}</math>表示第<math>c</math>个样本的第<math>r</math>个特征,则<math>A_c</math>表示<math>A</math>中的第<math>c</math>个基向量,则令
 +
<math>s_{r, c} \leftarrow \frac{ s_{r, c} } { \lVert A_c \rVert }.</math>
</ol>
</ol>
-
[一审]
+
无疑,这样的初始化有助于算法的改进,因为上述的第一步希望找到满足<math>Ws \approx x</math>的矩阵<math>s</math>;第二步对<math>s</math>作规范化处理是为了保持较小的稀疏惩罚值。这也表明,只采用上述步骤的某一步而不是两步对<math>s</math>做初始化处理将严重影响算法性能。 (TODO:此链接将会对为什么这样的初始化能改进算法作出更详细的解释)
-
 
+
-
在给定<math>A</math>的条件下,根据目标函数使用梯度下降(或其他方法)求解<math>s</math>之前找到良好的特征矩阵<math>s</math>的初始值是另一个快速高效收敛的重要技巧。实际上,每次迭代过程<math>s</math>的随机初始化导致收敛性较差,除非在优化<math>A</math>的最优值前已得到<math>s</math>的最优解。下面给出一个初始化<math>s</math>的较好方法:
+
-
<ol>
+
-
<li>令<math>s \leftarrow W^Tx</math> (<math>x</math> 是迷你块中patches的矩阵表示)
+
-
<li>对<math>s</math>做归一化处理:<math>s</math>中的每个特征(<math>s</math>的每一列)除以其在<math>A</math>中对应的基向量。即,如果 <math>s_{r, c}</math>表示<math>c</math>样本的第<math>r</math>个特征,<math>A_c</math>表示<math>A</math>中第<math>c</math>个基向量,则令<math>s_{r, c} \leftarrow \frac{ s_{r, c} } { \lVert A_c \rVert }.</math>
+
-
</ol>
+
-
 
+
-
[原文]
+
-
 
+
Very roughly and informally speaking, this initialization helps because the first step is an attempt to find a good <math>s</math> such that <math>Ws \approx x</math>, and the second step "normalizes" <math>s</math> in an attempt to keep the sparsity penalty small. It turns out that initializing <math>s</math> using only one but not both steps results in poor performance in practice. ([[TODO]]: a better explanation for why this initialization helps?)
Very roughly and informally speaking, this initialization helps because the first step is an attempt to find a good <math>s</math> such that <math>Ws \approx x</math>, and the second step "normalizes" <math>s</math> in an attempt to keep the sparsity penalty small. It turns out that initializing <math>s</math> using only one but not both steps results in poor performance in practice. ([[TODO]]: a better explanation for why this initialization helps?)
-
 
-
[初译]
 
-
 
-
无疑,这样的初始化有助于算法的改进。因为上述的第一步是求解满足<math>Ws \approx x</math>的<math>s</math> 的最优解,第二步的规范化处理是为了保持较小的稀疏惩罚值。实际运行证明,只用上述步骤的某一步代替这两步对<math>s</math>做初始化处理严重影响算法性能。
 
-
 
-
[一审]
 
-
 
-
无疑,这样的初始化有助于算法的改进。因为上述的第一步希望找到满足<math>Ws \approx x</math>的<math>s</math> 的最优解,第二步的规范化处理是为了保持较小的稀疏惩罚值。实际运行证明,只用上述步骤的某一步代替这两步对<math>s</math> 做初始化处理严重影响算法性能。
 
[原文]
[原文]

Revision as of 07:06, 21 March 2013

Personal tools