可视化自编码器训练结果
From Ufldl
Line 15: | Line 15: | ||
:【原文】: | :【原文】: | ||
:We will visualize the function computed by hidden unit ---which depends on the parameters <math>\textstyle W^{(1)}_{ij}</math> (ignoring the bias term for now)---using a 2D image. In particular, we think of <math>\textstyle a^{(2)}_i</math> as some non-linear feature of the input <math>\textstyle x</math>. We ask: What input image <math>\textstyle x</math> would cause <math>\textstyle a^{(2)}_i</math> to be maximally activated? (Less formally, what is the feature that hidden unit <math>\textstyle i</math> is looking for?) For this question to have a non-trivial answer, we must impose some constraints on <math>\textstyle x</math>. If we suppose that the input is norm constrained by <math>\textstyle ||x||^2 = \sum_{i=1}^{100} x_i^2 \leq 1</math>, then one can show (try doing this yourself) that the input which maximally activates hidden unit <math>\textstyle i</math> is given by setting pixel <math>\textstyle x_j</math> (for all 100 pixels, <math>\textstyle j=1,\ldots, 100</math>) to | :We will visualize the function computed by hidden unit ---which depends on the parameters <math>\textstyle W^{(1)}_{ij}</math> (ignoring the bias term for now)---using a 2D image. In particular, we think of <math>\textstyle a^{(2)}_i</math> as some non-linear feature of the input <math>\textstyle x</math>. We ask: What input image <math>\textstyle x</math> would cause <math>\textstyle a^{(2)}_i</math> to be maximally activated? (Less formally, what is the feature that hidden unit <math>\textstyle i</math> is looking for?) For this question to have a non-trivial answer, we must impose some constraints on <math>\textstyle x</math>. If we suppose that the input is norm constrained by <math>\textstyle ||x||^2 = \sum_{i=1}^{100} x_i^2 \leq 1</math>, then one can show (try doing this yourself) that the input which maximally activates hidden unit <math>\textstyle i</math> is given by setting pixel <math>\textstyle x_j</math> (for all 100 pixels, <math>\textstyle j=1,\ldots, 100</math>) to | ||
- | |||
- | |||
- | |||
:【初译】: | :【初译】: | ||
- | 我们将用2D图像对这个由隐藏单元i计算出的函数进行可视化,这个函数依赖于参数 | + | 我们将用2D图像对这个由隐藏单元i计算出的函数进行可视化,这个函数依赖于参数<math>\textstyle W^{(1)}_{ij}</math>(忽略掉偏置项<math>b_i\right</math>)。此时,如果我们将<math>\textstyle a^{(2)}_i</math>理解为输入向量<math>\textstyle x</math>的某个非线性特征值,我们需要思考:什么样的输入图像<math>\textstyle x</math>会使得激励<math>\textstyle a^{(2)}_i</math>取得最大值?(也就是说,隐藏单元<math>\textstyle i</math>找到的是一个什么样的特征值?)。因为这个问题需要有一个有实际意义的解,所以我们必须对<math>\textstyle x</math>加以限制。我们采用输入向量长度的平方<math>\textstyle ||x||^2 = \sum_{i=1}^{100} x_i^2 \leq 1</math>进行归一化限制,于是可以得到(请读者尝试自行推导。),当输入对隐藏单元<math>\textstyle i</math>产生最大的激励时,其输入像素<math>\textstyle x_j</math>(对所有100个输入像素,j=1,…,100)所取的值应为: |
:【一校】: | :【一校】: | ||
- | 接着我们将使用一个2D图像对这个由隐藏单元i负责计算的函数进行可视化,注意该函数依赖于参数集 | + | 接着我们将使用一个2D图像对这个由隐藏单元i负责计算的函数进行可视化,注意该函数依赖于参数集<math>\textstyle W^{(1)}_{ij}</math>(暂时忽略偏差项<math>b_i\right</math>)。如果再具体一些,我们可以将<math>\textstyle a^{(2)}_i</math>理解为输入向量<math>\textstyle x</math>的某个非线性特征。然后我们便想问:什么样的输入图像<math>\textstyle x</math>会最大程度上激励<math>\textstyle a^{(2)}_i</math>?(通俗一点的说法是隐藏单元<math>\textstyle i</math>需要找到的是一个什么样的特征?)。为了使这个问题有一个有实际意义的解释,我们必须对<math>\textstyle x</math>加以限制。如果假设输入向量符合<math>\textstyle ||x||^2 = \sum_{i=1}^{100} x_i^2 \leq 1</math>的范式限制,那么我们可以知道(请读者尝试自行推导。),当输入向量 对隐藏单元<math>\textstyle i</math>产生最大程度的激励时, 在2D图像中所对应的像素<math>\textstyle x_j</math>(对应的像素总共有100个,j=1,…,100)所取的值应为: |
:【二校】: | :【二校】: | ||
- | 接着我们使用一个2D图像对这个由隐藏单元i负责计算的函数进行可视化,该函数依赖于参数集 | + | 接着我们使用一个2D图像对这个由隐藏单元i负责计算的函数进行可视化,该函数依赖于参数集<math>\textstyle W^{(1)}_{ij}</math>(暂时忽略偏差项<math>b_i\right</math>)。更具体些,我们可以将<math>\textstyle a^{(2)}_i</math>理解为输入向量<math>\textstyle x</math>的某个非线性特征。然后我们便想问:什么样的输入图像<math>\textstyle a^{(2)}_i</math>会使<math>\textstyle a^{(2)}_i</math>得到最大程度的激励?(说通俗点,隐藏单元<math>\textstyle i</math>需要找到的是一个什么样的特征?)。为了使这个问题有一个有实际意义的解释,我们必须对<math>\textstyle x</math>加以限制。如果假设输入向量符合<math>\textstyle ||x||^2 = \sum_{i=1}^{100} x_i^2 \leq 1</math>的范式限制,那么我们可以知道(请读者尝试自行推导。),当输入向量 对隐藏单元<math>\textstyle i</math>产生最大程度的激励时, 在2D图像中所对应的像素<math>\textstyle x_j</math>(对应的像素总共有100个,j=1,…,100)所取的值应为: |
:【三校】: | :【三校】: | ||
- | 我们将要可视化的函数,就是上面这个以2D图像为输入、并由隐藏单元i计算出来的函数。它是依赖于参数 | + | 我们将要可视化的函数,就是上面这个以2D图像为输入、并由隐藏单元i计算出来的函数。它是依赖于参数<math>\textstyle W^{(1)}_{ij}</math>的(暂时忽略偏置项<math>b_i\right</math>)。需要注意的是,<math>\textstyle a^{(2)}_i</math>可看作输入<math>\textstyle x</math>的非线性特征。不过还有个问题:什么样的输入图像<math>\textstyle x</math>可让<math>\textstyle a^{(2)}_i</math>得到最大程度的激励?(通俗一点说,隐藏单元<math>\textstyle i</math>要找个什么样的特征?)。这里我们必须给<math>\textstyle x</math>加约束,否则会得到平凡解。若假设输入有范数约束<math>\textstyle ||x||^2 = \sum_{i=1}^{100} x_i^2 \leq 1</math>,则可证(请读者自行推导)令隐藏单元<math>\textstyle i</math>得到最大激励的输入应由下面公式计算的像素<math>\textstyle x_j</math>给出(共需计算100个像素,j=1,…,100): |
+ | :<math>\begin{align} | ||
+ | x_j = \frac{W^{(1)}_{ij}}{\sqrt{\sum_{j=1}^{100} (W^{(1)}_{ij})^2}}. | ||
+ | \end{align}</math> | ||
:【三校说明】: | :【三校说明】: | ||
原文第一句有“using a 2D image”,我这里译为“以2D图像为输入”,一则表达意思相同,二则与上一段最后一句呼应。 | 原文第一句有“using a 2D image”,我这里译为“以2D图像为输入”,一则表达意思相同,二则与上一段最后一句呼应。 | ||
原文中的“in particular”,应为强调之意。 | 原文中的“in particular”,应为强调之意。 | ||
原文“as some non-linear feature”中的“some”,似不译为好。非线性特征当然可以有很多,而这里计算出来的当然也只是其中一种,其意不言自明。 | 原文“as some non-linear feature”中的“some”,似不译为好。非线性特征当然可以有很多,而这里计算出来的当然也只是其中一种,其意不言自明。 | ||
- | + | ||
:【原文】: | :【原文】: | ||
By displaying the image formed by these pixel intensity values, we can begin to understand what feature hidden unit <math>\textstyle i</math> is looking for. | By displaying the image formed by these pixel intensity values, we can begin to understand what feature hidden unit <math>\textstyle i</math> is looking for. | ||
Line 88: | Line 88: | ||
:【专业术语对照表】: | :【专业术语对照表】: | ||
- | + | 为了在后期校对时,使前后章节专业术语翻译统一,在此将本章中专业术语翻译的中英文对照总结到下表,以便统一修改,或用于后期专业名词附录。 | |
- | (稀疏)自编码器 (sparse) autoencoder | + | :(稀疏)自编码器 (sparse) autoencoder |
- | 隐藏单元 hidden unit | + | :隐藏单元 hidden unit |
- | 偏置项 bias term | + | :偏置项 bias term |
- | 激励 activate | + | :激励 activate |
- | 范数约束 norm constrained | + | :范数约束 norm constrained |
- | 白化 whitening | + | :白化 whitening |
:【三校说明】: | :【三校说明】: | ||
这里的“偏置项”和“范数约束”,我想都应是习惯用法吧。“白化”的译法是和系列中同名教程相统一的。 | 这里的“偏置项”和“范数约束”,我想都应是习惯用法吧。“白化”的译法是和系列中同名教程相统一的。 |