白化
From Ufldl
Line 137: | Line 137: | ||
:【初译】: | :【初译】: | ||
+ | |||
+ | :ZCA白化 | ||
最后,事实证明使数据的协方差矩阵为单位矩阵<math>\textstyle I</math>的方式并不唯一。具体地,如果<math>\textstyle R</math>是任意正交矩阵,即满足<math>\textstyle RR^T = R^TR = I</math>(不太正式地讲,若<math>\textstyle R</math>是旋转/反射矩阵), 那么<math>\textstyle R \,x_{\rm PCAwhite}</math>具有单位协方差。在 ZCA白化中,令<math>\textstyle R = U</math>.我们定义: | 最后,事实证明使数据的协方差矩阵为单位矩阵<math>\textstyle I</math>的方式并不唯一。具体地,如果<math>\textstyle R</math>是任意正交矩阵,即满足<math>\textstyle RR^T = R^TR = I</math>(不太正式地讲,若<math>\textstyle R</math>是旋转/反射矩阵), 那么<math>\textstyle R \,x_{\rm PCAwhite}</math>具有单位协方差。在 ZCA白化中,令<math>\textstyle R = U</math>.我们定义: | ||
Line 149: | Line 151: | ||
:【一校】: | :【一校】: | ||
+ | |||
+ | :ZCA白化 | ||
最后要说明的是,使数据的协方差矩阵变为单位矩阵<math>\textstyle I</math>的方式并不唯一。具体地,如果<math>\textstyle R</math>是任意正交矩阵,即满足<math>\textstyle RR^T = R^TR = I</math>(不太正式地讲,<math>\textstyle R</math>是旋转或反射矩阵), 那么<math>\textstyle R \,x_{\rm PCAwhite}</math>仍然具有单位协方差。在 ZCA白化中,令<math>\textstyle R = U</math>.我们定义ZCA白化的结果为: | 最后要说明的是,使数据的协方差矩阵变为单位矩阵<math>\textstyle I</math>的方式并不唯一。具体地,如果<math>\textstyle R</math>是任意正交矩阵,即满足<math>\textstyle RR^T = R^TR = I</math>(不太正式地讲,<math>\textstyle R</math>是旋转或反射矩阵), 那么<math>\textstyle R \,x_{\rm PCAwhite}</math>仍然具有单位协方差。在 ZCA白化中,令<math>\textstyle R = U</math>.我们定义ZCA白化的结果为: | ||
Line 162: | Line 166: | ||
:【原文】: | :【原文】: | ||
+ | :Regularizaton | ||
+ | When implementing PCA whitening or ZCA whitening in practice, sometimes some | ||
+ | of the eigenvalues <math>\textstyle \lambda_i</math> will be numerically close to 0, and thus the scaling | ||
+ | step where we divide by <math>\sqrt{\lambda_i}</math> would involve dividing by a value close to zero; this | ||
+ | may cause the data to blow up (take on large values) or otherwise be numerically unstable. In practice, we | ||
+ | therefore implement this scaling step using | ||
+ | a small amount of regularization, and add a small constant <math>\textstyle \epsilon</math> | ||
+ | to the eigenvalues before taking their square root and inverse: | ||
+ | :<math>\begin{align} | ||
+ | x_{{\rm PCAwhite},i} = \frac{x_{{\rm rot},i} }{\sqrt{\lambda_i + \epsilon}}. | ||
+ | \end{align}</math> | ||
+ | When <math>\textstyle x</math> takes values around <math>\textstyle [-1,1]</math>, a value of <math>\textstyle \epsilon \approx 10^{-5}</math> | ||
+ | might be typical. | ||
:【初译】: | :【初译】: | ||
- | + | 实践中需要实现PCA白化或ZCA白化时,有时一些特征值<math>\textstyle \lambda_i</math>在数值上接近于0, 这样在缩放步骤时我们除以<math>\sqrt{\lambda_i}</math>将导致除以一个接近0的值;这可能使数据上溢 (赋为大数值)或造成数值不稳定。因而在实践中,我们使用些许的正则化实现这个缩放过程,即在取平方根和倒数之前给特征值加上一个很小的常数<math>\textstyle \epsilon</math>: | |
+ | :<math>\begin{align} | ||
+ | x_{{\rm PCAwhite},i} = \frac{x_{{\rm rot},i} }{\sqrt{\lambda_i + \epsilon}}. | ||
+ | \end{align}</math> | ||
+ | 当<math>\textstyle x</math>在区间<math>\textstyle [-1,1]</math>上时, 一般取值为<math>\textstyle \epsilon \approx 10^{-5}</math>。 | ||
:【一校】: | :【一校】: | ||
- | + | 实践中需要实现PCA白化或ZCA白化时,有时一些特征值<math>\textstyle \lambda_i</math>在数值上接近于0, 这样在缩放步骤时我们除以<math>\sqrt{\lambda_i}</math>将导致除以一个接近0的值;这可能使数据上溢 (赋为大数值)或造成数值不稳定。因而在实践中,我们使用少量的正则化实现这个缩放过程,即在取平方根和倒数之前给特征值加上一个很小的常数<math>\textstyle \epsilon</math>: | |
+ | :<math>\begin{align} | ||
+ | x_{{\rm PCAwhite},i} = \frac{x_{{\rm rot},i} }{\sqrt{\lambda_i + \epsilon}}. | ||
+ | \end{align}</math> | ||
+ | 当<math>\textstyle x</math>在区间<math>\textstyle [-1,1]</math>上时, 一般取值为<math>\textstyle \epsilon \approx 10^{-5}</math>。 | ||
:【原文】: | :【原文】: | ||
+ | For the case of images, adding <math>\textstyle \epsilon</math> here also has the effect of slightly smoothing (or low-pass | ||
+ | filtering) the input image. This also has a desirable effect of removing aliasing artifacts | ||
+ | caused by the way pixels are laid out in an image, and can improve the features learned | ||
+ | (details are beyond the scope of these notes). | ||
+ | ZCA whitening is a form of pre-processing of the data that maps it from <math>\textstyle x</math> to | ||
+ | <math>\textstyle x_{\rm ZCAwhite}</math>. It turns out that this is also a rough model of how the | ||
+ | biological eye (the retina) processes images. Specifically, as your eye | ||
+ | perceives images, most adjacent "pixels" in your eye will perceive very | ||
+ | similar values, since adjacent parts of an image tend to be highly correlated | ||
+ | in intensity. It is thus wasteful for your eye to have to transmit every pixel | ||
+ | separately (via your optic nerve) to your brain. Instead, your retina performs | ||
+ | a decorrelation operation (this is done via retinal neurons that compute a function | ||
+ | called "on center, off surround/off center, on surround") which is similar to that | ||
+ | performed by ZCA. This results in a less redundant representation of the input | ||
+ | image, which is then transmitted to your brain. | ||
:【初译】: | :【初译】: | ||
- | + | 对图像来说, 这里加上<math>\textstyle \epsilon</math>,对输入图像也有一些平滑(或低通滤波)的作用。这样处理还能消除在图像的像素信息获取过程中产生的人为的噪声,改善学习到的特征。(细节超出了本文的范围). | |
- | + | ZCA 白化是一种对数据的预处理方法,它将数据从<math>\textstyle x</math>映射到<math>\textstyle x_{\rm ZCAwhite}</math>。 事实证明这也是一种对生物的眼睛(视网膜)处理图像的粗糙的模型。特别地,当你的眼睛感知图像时,由于一幅图像中相邻的部分在亮度上十分相关,大多数临近的“像素”在你眼中被感知为相近的值。你的眼睛如果需要分别传输每个像素(通过视觉神经)到你的大脑中,会非常不划算。取而代之的是,你的视网膜进行一个与ZCA中相似的去相关操作 (这由视网膜神经元通过计算一个称作“在中心, 不在周围/不在中心, 在周围”的函数完成)。由此得到一个对输入图像更低冗余的表示,然后它将被传输到你的大脑。 | |
:【一校】: | :【一校】: | ||
- | + | 对图像来说, 这里加上<math>\textstyle \epsilon</math>,对输入图像也有一些平滑(或低通滤波)的作用。这样处理还能消除在图像的像素信息获取过程中产生的噪声,改善学习到的特征。(细节超出了本文的范围). | |
- | + | ZCA 白化是一种数据预处理方法,它将数据从<math>\textstyle x</math>映射到<math>\textstyle x_{\rm ZCAwhite}</math>。 事实证明这也是一种对生物眼睛(视网膜)处理图像的粗糙的模型。眼睛感知图像时,由于一幅图像中相邻的部分在亮度上十分相关,大多数临近的“像素”在眼中被感知为相近的值。人眼如果分别传输每个像素(通过视觉神经)到大脑中,会非常不划算。取而代之的是,视网膜进行一个与ZCA中相似的去相关操作 (这是由视网膜上的ON-型和OFF-型光感受器细胞将光信号转变为神经信号完成的)。由此得到对输入图像的更低冗余的表示,并将它被传输到大脑。 | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + |