白化
From Ufldl
for
白化
Jump to:
navigation
,
search
:【原文】: :Introduction We have used PCA to reduce the dimension of the data. There is a closely related preprocessing step called whitening (or, in some other literatures, sphering) which is needed for some algorithms. If we are training on images, the raw input is redundant, since adjacent pixel values are highly correlated. The goal of whitening is to make the input less redundant; more formally, our desiderata are that our learning algorithms sees a training input where (i) the features are less correlated with each other, and (ii) the features all have the same variance. :【初译】: :介绍 我们使用过 PCA 来降低数据维度. 还有一个与之非常相关的预处理步骤叫 白化 (一些文献中也称sphering) ,一些算法中需要这个步骤. 当在图像数据上进行训练时, 由于相邻像素值高度相关,原始的输入具有冗余性。白化的目标是降低输入的冗余性;更形式化地说,我们需要的是使我们的学习算法可以有一个供训练的输入使得:(i) 特征之间相关性更低 (ii) 特征都有相同的方差。 :【一校】: 我们已经了解了如何使用PCA降低数据维度。在一些算法中还需要一个与之相关的预处理步骤,这个预处理过程称为白化(一些文献中也叫shpering)。举例来说,假设训练数据是图像,由于图像中相邻像素之间具有很强的相关性,如果用原始图像数据作为输入的话,输入是冗余的。白化的目的就是降低输入的冗余性;更正式的说,我们希望通过白化过程使得学习算法的输入具有如下性质:(i)特征之间相关性较低;(ii)所有特征具有相同的方差。 :【原文】: :2D example We will first describe whitening using our previous 2D example. We will then describe how this can be combined with smoothing, and finally how to combine this with PCA. How can we make our input features uncorrelated with each other? We had already done this when computing <math>x_{rot}^{(i)}=U^Tx^{(i)}</math>. Repeating our previous figure, our plot for <math>x_{rot}</math> was: :【初译】: :2D 的例子 首先我们将通过之前的 2D 例子描述白化。然后描述其与smoothing的结合, 最后讨论如何与PCA结合。 我们如何消除输入特征之间的相关性? 在计算<math>x_{rot}^{(i)}=U^Tx^{(i)}</math>时我们其实已经完成了。回顾之前的图表, 在坐标系中绘出<math>x_{rot}</math>: :【一校】: 下面我们先用前文的2D例子描述白化的主要思想,然后分别介绍如何将白化与平滑和PCA相结合。 在前文计算<math>x_{rot}^{(i)}=U^Tx^{(i)}</math>时我们实际上已经消除了输入特征<math>x^{(i)}</math>之间的相关性。得到的新特征<math>x_{rot}</math>的分布如下图所示: [[File:PCA-rotated.png | 600px]] :【原文】: The covariance matrix of this data is given by: <math>\begin{align} \begin{bmatrix} 7.29 & 0 \\ 0 & 0.69 \end{bmatrix}. \end{align}</math> (Note: Technically, many of the statements in this section about the "covariance" will be true only if the data has zero mean. In the rest of this section, we will take this assumption as implicit in our statements. However, even if the data's mean isn't exactly zero, the intuitions we're presenting here still hold true, and so this isn't something that you should worry about.) :【初译】: 数据的协方差矩阵如下: (注: 严格地讲, 这部分许多关于“协方差”的陈述仅当数据以0为均值时成立。接下来,我们将这一假设作为隐含条件。然而,即使数据不以0为均值,我们在这里提出的仍然保持正确,因此读者无需担心。) :【一校】: 数据的协方差矩阵如下: (注: 严格地讲, 这部分许多关于“协方差”的陈述仅当数据均值为0时成立。下文的论述都隐式地假定这一条件成立。不过即使数据均值不为0,下文的说法仍然成立。) :【原文】: It is no accident that the diagonal values are <math>\textstyle \lambda_1</math> and <math>\textstyle \lambda_2</math>. Further, the off-diagonal entries are zero; thus, <math>\textstyle x_{{\rm rot},1}</math> and <math>\textstyle x_{{\rm rot},2}</math> are uncorrelated, satisfying one of our desiderata for whitened data (that the features be less correlated). To make each of our input features have unit variance, we can simply rescale each feature <math>\textstyle x_{{\rm rot},i}</math> by <math>\textstyle 1/\sqrt{\lambda_i}</math>. Concretely, we define our whitened data <math>\textstyle x_{{\rm PCAwhite}} \in \Re^n</math> as follows: :<math>\begin{align} x_{{\rm PCAwhite},i} = \frac{x_{{\rm rot},i} }{\sqrt{\lambda_i}}. \end{align}</math> Plotting <math>\textstyle x_{{\rm PCAwhite}}</math>, we get: [[File:PCA-whitened.png | 600px]] :【初译】: 毫无疑问,对角元素的值为<math>\textstyle \lambda_1</math>和<math>\textstyle \lambda_2</math>。非对角元素值为0; 并且,<math>\textstyle x_{{\rm rot},1}</math>和<math>\textstyle x_{{\rm rot},2}</math>是不相关的, 满足其中一个我们对白化结果的要求 (特征间更不相关)。 为了使我们每个输入特征具有单位方差,可以直接使用<math>\textstyle 1/\sqrt{\lambda_i}</math>来缩放每个特征<math>\textstyle x_{{\rm rot},i}</math>。具体地,我们定义白化后的数据<math>\textstyle x_{{\rm PCAwhite}} \in \Re^n</math>如下: 绘制出<math>\textstyle x_{{\rm PCAwhite}}</math>, 我们得到: :【一校】: 毫无疑问, 协方差矩阵对角元素的值为<math>\textstyle \lambda_1</math>和<math>\textstyle \lambda_2</math>。非对角元素值为0; 并且,<math>\textstyle x_{{\rm rot},1}</math>和<math>\textstyle x_{{\rm rot},2}</math>是不相关的, 满足我们对白化结果的第一个要求 (特征间相关性降低)。 为了使每个输入特征具有单位方差,我们可以直接使用<math>\textstyle 1/\sqrt{\lambda_i}</math>来缩放每个特征<math>\textstyle x_{{\rm rot},i}</math>。具体地,我们定义白化后的数据<math>\textstyle x_{{\rm PCAwhite}} \in \Re^n</math>如下: 绘制出<math>\textstyle x_{{\rm PCAwhite}}</math>, 我们得到: :【原文】: This data now has covariance equal to the identity matrix <math>\textstyle I</math>. We say that <math>\textstyle x_{{\rm PCAwhite}}</math> is our '''PCA whitened''' version of the data: The different components of <math>\textstyle x_{{\rm PCAwhite}}</math> are uncorrelated and have unit variance. '''Whitening combined with dimensionality reduction.''' If you want to have data that is whitened and which is lower dimensional than the original input, you can also optionally keep only the top <math>\textstyle k</math> components of <math>\textstyle x_{{\rm PCAwhite}}</math>. When we combine PCA whitening with regularization (described later), the last few components of <math>\textstyle x_{{\rm PCAwhite}}</math> will be nearly zero anyway, and thus can safely be dropped. :【初译】: 这些数据现在的协方差矩阵为单位矩阵<math>\textstyle I</math>. 我们说,<math>\textstyle x_{{\rm PCAwhite}}</math>是数据经过PCA白化的版本:<math>\textstyle x_{{\rm PCAwhite}}</math>中不同的成分是不相关的并且具有单位方差。 白化与维度降低相结合. 如果你想得到经过白化并且维度比初试输入更低的数据, 你也可以任意地仅保留前<math>\textstyle k</math>个<math>\textstyle x_{{\rm PCAwhite}}</math>中的成分。当我们把PCA白化和正则化结合起来时(在稍后讨论),在最后的一些<math>\textstyle x_{{\rm PCAwhite}}</math>的成分将总是接近于0,因此可以放心地舍弃它们。 :【一校】: 这些数据现在的协方差矩阵为单位矩阵<math>\textstyle I</math>. 我们说,<math>\textstyle x_{{\rm PCAwhite}}</math>是数据经过PCA白化后的版本:<math>\textstyle x_{{\rm PCAwhite}}</math>中不同的特征之间是不相关并且具有单位方差。 白化与降维相结合. 如果你要经过白化并且维度比初始输入更低维的数据, 也可以仅保留<math>\textstyle x_{{\rm PCAwhite}}</math>中前<math>\textstyle k</math>个的成分。当我们把PCA白化和正则化结合起来时(在稍后讨论),<math>\textstyle x_{{\rm PCAwhite}}</math>中最后的少量成分将总是接近于0,因而舍弃这些成分不会带来很大的问题。 :【原文】: :ZCA Whitening Finally, it turns out that this way of getting the data to have covariance identity <math>\textstyle I</math> isn't unique. Concretely, if <math>\textstyle R</math> is any orthogonal matrix, so that it satisfies <math>\textstyle RR^T = R^TR = I</math> (less formally, if <math>\textstyle R</math> is a rotation/reflection matrix), then <math>\textstyle R \,x_{\rm PCAwhite}</math> will also have identity covariance. In '''ZCA whitening''', we choose <math>\textstyle R = U</math>. We define :<math>\begin{align} x_{\rm ZCAwhite} = U x_{\rm PCAwhite} \end{align}</math> Plotting <math>\textstyle x_{\rm ZCAwhite}</math>, we get: [[File:ZCA-whitened.png | 600px]] It can be shown that out of all possible choices for <math>\textstyle R</math>, this choice of rotation causes <math>\textstyle x_{\rm ZCAwhite}</math> to be as close as possible to the original input data <math>\textstyle x</math>. When using ZCA whitening (unlike PCA whitening), we usually keep all <math>\textstyle n</math> dimensions of the data, and do not try to reduce its dimension. :【初译】: 最后,事实证明使数据的协方差矩阵为单位矩阵<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>\begin{align} x_{\rm ZCAwhite} = U x_{\rm PCAwhite} \end{align}</math> 绘制<math>\textstyle x_{\rm ZCAwhite}</math>,得到: 可以看到,对所有可能的<math>\textstyle R</math>,这种旋转使得<math>\textstyle R</math>尽可能地接近原始输入数据<math>\textstyle x</math>. 当使用 ZCA白化时(不同于 PCA白化),我们通常保留数据的全部<math>\textstyle n</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>.我们定义ZCA白化的结果为: :<math>\begin{align} x_{\rm ZCAwhite} = U x_{\rm PCAwhite} \end{align}</math> 绘制<math>\textstyle x_{\rm ZCAwhite}</math>,得到: 可以证明,对所有可能的<math>\textstyle R</math>,这种旋转使得<math>\textstyle R</math>尽可能地接近原始输入数据<math>\textstyle x</math>. 当使用 ZCA白化时(不同于 PCA白化),我们通常保留数据的全部<math>\textstyle n</math>个维度,不尝试去降低它的维数。 :【原文】: :【初译】: :【一校】: :【原文】: :【初译】: :【一校】: :【原文】: :【初译】: :【一校】: :【原文】: :【初译】: :【一校】: :【原文】: :【初译】: :【一校】: :【原文】: :【初译】: :【一校】:
Template:Languages
(
view source
)
Template:预处理:主成分分析与白化
(
view source
)
Return to
白化
.
Views
Page
Discussion
View source
History
Personal tools
Log in
ufldl resources
UFLDL Tutorial
Recommended Readings
wiki
Main page
Recent changes
Random page
Help
Search
Toolbox
What links here
Related changes
Special pages