从自我学习到深层网络

From Ufldl

Jump to: navigation, search
Line 6: Line 6:
-
【原文】
+
在前一节中,我们利用自编码器来学习输入至softmax或logistic回归分类器的特征。这些特征仅利用未标注数据学习获得。在本节中,我们描述如何利用未标注数据进行'''微调''',从而进一步优化这些特征。如果有大量已标注数据,通过微调就可以显著提升分类器的性能。
-
In the previous section, you used an autoencoder to learn features that were then fed as input to a softmax or logistic regression classifier. In that method, the features were learned using only unlabeled data. In this section, we describe how you can '''fine-tune''' and further improve the learned features using labeled data. When you have a large amount of labeled training data, this can significantly improve your classifier's performance.
+
-
【初译】
 
-
在此前的章节中,我们利用自动编码机来学习输入至softmax或logistic回归分类器的特征。上述方法中的特征仅利用未标注数据学习获得。在本章节中,我们描述了'''微调'''这一方法,即利用标注数据优化学习得到的特征。如果你拥有大量标注数据,可以显著提升分类器的性能。
 
-
【一审】
+
在自我学习中,我们首先利用未标注数据训练一个稀疏自编码器。随后,给定一个新样本<math>\textstyle x</math>,我们通过隐含层提取出特征<math>\textstyle a</math>。上述过程图示如下:
-
在此前的章节中,我们利用自动编码器来学习输入至softmax回归或logistic回归分类器的特征。上述方法中的特征仅利用未标注数据学习获得。在本章节中,我们描述了'''微调'''这一方法,即利用标注数据优化学习得到的特征。如果你拥有大量标注数据,可以显著提升分类器的性能。
+
-
 
+
-
 
+
-
【原文】
+
-
In self-taught learning, we first trained a sparse autoencoder on the unlabeled data. Then, given a new example <math>x</math>, we used the hidden layer to extract features <math>a</math>. This is illustrated in the following diagram:
+
-
 
+
-
【初译】
+
-
在自我学习中,我们首先利用未标注数据训练一个稀疏自动编码机。随后,给定一个新样本<math>x</math>,我们通过隐层提取出特征<math>a</math>。上述过程图示如下:
+
-
 
+
-
【一审】
+
-
在自我学习中,我们首先利用未标注数据训练一个稀疏自动编码器。随后,给定一个新样本<math>x</math>,我们通过隐含层提取出特征<math>a</math>。上述过程图示如下:
+
[[File:Section15_Fig1.jpg]]
[[File:Section15_Fig1.jpg]]
-
【原文】
+
我们感兴趣的是分类问题,目标是预测样本的类别标号<math>\textstyle y</math>。我们拥有标注数据集<math>\textstyle \{ (x_l^{(1)}, y^{(1)}), (x_l^{(2)}, y^{(2)}), \ldots (x_l^{(m_l)},y^{(m_l)}) \}</math>,包含<math>\textstyle m_l</math>个标注样本。此前我们已经说明,可以利用稀疏自编码器获得的特征<math>\textstyle a^{(l)}</math>来替代原始特征。这样就可获得训练数据集<math>\textstyle \{(a^{(1)},y^{(1)}), \ldots (a^{(m_l)}, y^{(m_l)}) \}</math>。最终,我们训练出一个从特征<math>\textstyle a^{(i)}</math>到类标号<math>\textstyle y^{(i)}</math>的logistic分类器。为说明这一过程,我们按照[[神经网络|神经网络]]一节中的方式,用下图描述logistic回归单元(橘黄色)。
-
We are interested in solving a classification task, where our goal is to predict labels <math>\textstyle y</math>.  We have a labeled training set <math>\textstyle \{ (x_l^{(1)}, y^{(1)}), (x_l^{(2)}, y^{(2)}), \ldots (x_l^{(m_l)},y^{(m_l)}) \}</math> of <math>\textstyle m_l</math> labeled examples. We showed previously that we can replace the original features <math>\textstyle x^{(i)}</math> with features <math>\textstyle a^{(l)}</math> computed by the sparse autoencoder (the "replacement" representation).  This gives us a training set <math>\textstyle \{(a^{(1)},y^{(1)}), \ldots (a^{(m_l)}, y^{(m_l)}) \}</math>.  Finally, we train a logistic classifier to map from the features <math>\textstyle a^{(i)}</math> to the classification label <math>\textstyle y^{(i)}</math>. To illustrate this step, similar to [[Neural Networks|our earlier notes]], we can draw our logistic regression unit (shown in orange) as follows:
+
-
 
+
-
【初译】
+
-
我们感兴趣的是解决一个分类任务,目标是预测样本类型<math>\textstyle y</math>。我们拥有标注数据集<math>\textstyle \{ (x_l^{(1)}, y^{(1)}), (x_l^{(2)}, y^{(2)}), \ldots (x_l^{(m_l)},y^{(m_l)}) \}</math>,包含<math>\textstyle m_l</math>个标注样本。此前我们已经证明,可以利用稀疏自动编码机计算获得的特征<math>\textstyle a^{(l)}</math> (“替代”表示)来替代初始特征<math>\textstyle x^{(i)}</math>。如此,我们就获得训练数据集<math>\textstyle \{(a^{(1)},y^{(1)}), \ldots (a^{(m_l)}, y^{(m_l)}) \}</math>。最终,我们训练得到一个从特征<math>\textstyle a^{(i)}</math> 到分类标注<math>\textstyle y^{(i)}</math>的logistic分类器。为说明这一过程,如同[[Neural Networks|我们此前的笔记]],可以如下图描述logistic回归单元(橘黄色)。
+
-
 
+
-
【一审】
+
-
我们感兴趣的是解决一个分类任务,目标是预测标注类型<math>\textstyle y</math>。我们拥有标注训练集<math>\textstyle \{ (x_l^{(1)}, y^{(1)}), (x_l^{(2)}, y^{(2)}), \ldots (x_l^{(m_l)},y^{(m_l)}) \}</math>,包含<math>\textstyle m_l</math>个标注样本。此前我们已经证明,可以利用稀疏自动编码器计算获得的特征<math>\textstyle a^{(l)}</math>(“替代”表示)来替代初始特征。如此,我们就获得训练数据集<math>\textstyle \{(a^{(1)},y^{(1)}), \ldots (a^{(m_l)}, y^{(m_l)}) \}</math>。最终,我们训练得到一个从特征<math>\textstyle a^{(i)}</math> 到分类标注<math>\textstyle y^{(i)}</math>的logistic分类器。为说明这一过程,如同[[Neural Networks|我们此前的笔记]],可以如下图描述logistic回归单元(橘黄色)。
+
[[File:Section15_Fig2.jpg]]
[[File:Section15_Fig2.jpg]]
-
【原文】
+
考虑利用这个方法所学到的分类器(输入-输出映射)。它描述了一个把测试样本<math>\textstyle x</math>映射到预测值<math>\textstyle p(y=1|x)</math>的函数。将此前的两张图片结合起来,就得到该函数的图形表示。也即,最终的分类器可以表示为:
-
Now, consider the overall classifier (i.e., the input-output mapping) that we have learned using this method. In particular, let us examine the function that our classifier uses to map from from a new test example <math>\textstyle x</math> to a new prediction <math>p(y=1|x)</math>. We can draw a representation of this function by putting together the two pictures from above. In particular, the final classifier looks like this:
+
-
 
+
-
【初译】
+
-
现在,考虑我们利用这个方法所学到的整个分类器(输入-输出映射)。尤其的,一个新测试样本<math>\textstyle x</math>到一个新预测结果<math>p(y=1|x)</math>的映射可以通过一个函数所表示。将此前的两张图片结合起来,我们可以获得该映射函数的图形表示。最终的分类器可以表示为:
+
-
 
+
-
【一审】
+
-
现在,考虑我们利用这个方法所学到的整个分类器(输入-输出映射)。具体来说,让我们通过把一个新的测试样<math>\textstyle x</math>本映射到一个新的预测<math>p(y=1|x)</math>来检验我们的分类器。。将此前的两张图片结合起来,我们可以获得该映射函数的图形表示。最终的分类器可以表示为:
+
[[File:Section15_Fig3.jpg]]
[[File:Section15_Fig3.jpg]]
-
【原文】
+
该模型的参数通过两个步骤训练获得:在该网络的第一层,将输入<math>\textstyle x</math>映射至隐藏单元激活量<math>\textstyle a</math>的权值<math>\textstyle W^{(1)}</math>可以通过稀疏自编码器训练过程获得。在第二层,将隐藏单元<math>\textstyle a</math>映射至输出<math>\textstyle y</math>的权值<math>\textstyle W^{(2)}</math>可以通过logistic回归或softmax回归训练获得。
-
The parameters of this model were trained in two stages: The first layer of weights <math>\textstyle W^{(1)}</math> mapping from the input <math>\textstyle x</math> to the hidden unit activations <math>\textstyle a</math> were trained as part of the sparse autoencoder training process. The second layer of weights <math>\textstyle W^{(2)}</math> mapping from the activations <math>\textstyle a</math> to the output <math>\textstyle y</math> was trained using logistic regression (or softmax regression).
+
-
 
+
-
【初译】
+
-
该模型的参数通过两个步骤训练获得:首先将输入值<math>\textstyle x</math>映射至隐藏单元activations <math>\textstyle a</math>,对应的第一层权值<math>\textstyle W^{(1)}</math>可以通过自动编码机训练获得。其次将隐藏单元activations <math>\textstyle a</math>映射至输出值<math>\textstyle y</math>,对应的第二层权值<math>\textstyle W^{(2)}</math>可以通过logistic回归或softmax回归训练获得。
+
-
 
+
-
【一审】
+
-
该模型的参数通过两个步骤训练获得:第一层从输入<math>\textstyle x</math>到隐含单元<math>\textstyle a</math>的权重权值<math>\textstyle W^{(1)}</math>映射可以通过稀疏自动编码器训练过程训练获得。第二层从激活<math>\textstyle a</math>到输出<math>\textstyle y</math>的权重<math>\textstyle W^{(2)}</math>映射可以通过logistic回归或softmax回归训练获得。
+
-
 
+
-
 
+
-
【原文】
+
-
But the form of our overall/final classifier is clearly just a whole big neural network. So, having trained up an initial set of parameters for our model (training the first layer using an autoencoder, and the second layer via logistic/softmax regression), we can further modify all the parameters in our model to try to further reduce the training error. In particular, we can fine-tune the parameters, meaning perform gradient descent (or use L-BFGS) from the current setting of the parameters to try to reduce the training error on our labeled training set <math>\textstyle \{ (x_l^{(1)}, y^{(1)}), (x_l^{(2)}, y^{(2)}), \ldots (x_l^{(m_l)}, y^{(m_l)}) \}</math>.
+
-
 
+
-
【初译】
+
-
我们描述的整个/最终分类器明显是一个更大的神经网络。因此,在训练获得模型初始参数(利用自动编码机训练第一层,利用logistic/softmax回归训练第二层)之后,我们可以进一步修正模型参数,进而降低训练误差。尤其是,我们可以对参数进行微调,在现有参数的基础上采用梯度下降或者L-BFGS来降低标注样本集<math>\textstyle \{ (x_l^{(1)}, y^{(1)}), (x_l^{(2)}, y^{(2)}), \ldots (x_l^{(m_l)}, y^{(m_l)}) \}</math>的训练误差。
+
-
 
+
-
【一审】
+
-
我们描述的整个/最终分类器明显是一整个大的神经网络。因此,在训练获得模型最初参数(利用自动编码器训练第一层,利用logistic/softmax回归训练第二层)之后,我们可以进一步修正模型参数,进而降低训练误差。具体来说,我们可以对参数进行微调,在现有参数的基础上采用梯度下降或者L-BFGS来降低标注样本集
+
-
<math>\textstyle \{ (x_l^{(1)}, y^{(1)}), (x_l^{(2)}, y^{(2)}), \ldots (x_l^{(m_l)}, y^{(m_l)}) \}</math>的训练误差。
+
-
 
+
-
 
+
-
【原文】
+
-
When fine-tuning is used, sometimes the original unsupervised feature learning steps (i.e., training the autoencoder and the logistic classifier) are called pre-training. The effect of fine-tuning is that the labeled data can be used to modify the weights <math>W^{(1)}</math> as well, so that adjustments can be made to the features <math>a</math> extracted by the layer of hidden units.
+
-
 
+
-
【初译】
+
-
开展微调的时候,初始的非监督特征学习步骤(也就是自动编码机和logistic分类器训练)有时候被称为预训练。微调的好处在于,标注数据集也可以用来修正权值<math>W^{(1)}</math>,因此通过隐层提取的特征<math>a</math>也可以获得修正。
+
-
【一审】
 
-
开展微调的时候,初始的非监督特征学习步骤(也就是自动编码器和logistic分类器训练)有时候被称为预训练。微调的好处在于,标注数据集也可以用来修正权值<math>W^{(1)}</math>,因此通过隐含单元层所提取的特征<math>a</math>也可以获得修正。
 
-
【原文】
+
这个最终分类器整体上显然是一个大的神经网络。因此,在训练获得模型最初参数(利用自动编码器训练第一层,利用logistic/softmax回归训练第二层)之后,我们可以进一步修正模型参数,进而降低训练误差。具体来说,我们可以对参数进行微调,在现有参数的基础上采用梯度下降或者L-BFGS来降低已标注样本集
-
So far, we have described this process assuming that you used the "replacement" representation, where the training examples seen by the logistic classifier are of the form <math>(a^{(i)}, y^{(i)})</math>, rather than the "concatenation" representation, where the examples are of the form <math>((x^{(i)}, a^{(i)}), y^{(i)})</math>. It is also possible to perform fine-tuning too using the "concatenation" representation. (This corresponds to a neural network where the input units <math>x_i</math> also feed directly to the logistic classifier in the output layer. You can draw this using a slightly different type of neural network diagram than the ones we have seen so far; in particular, you would have edges that go directly from the first layer input nodes to the third layer output node, "skipping over" the hidden layer.) However, so long as we are using finetuning, usually the "concatenation" representation has little advantage over the "replacement" representation. Thus, if we are using fine-tuning usually we will do so with a network built using the replacement representation. (If you are not using fine-tuning however, then sometimes the concatenation representation can give much better performance.)
+
<math>\textstyle \{ (x_l^{(1)}, y^{(1)}), (x_l^{(2)}, y^{(2)}), \ldots (x_l^{(m_l)}, y^{(m_l)}) \}</math>上的训练误差。
-
【初译】
 
-
到现在为止,我们描述上述过程时,都假设采用了“替代”表示而不是“级联”表示。在替代表示中,logistic分类器所看到的训练样本格式为<math>(a^{(i)}, y^{(i)})</math>;而在级联表示中,分类器所看到的训练样本格式为<math>((x^{(i)}, a^{(i)}), y^{(i)})</math>。对级联表示同样可以开展微调(在级联表示神经网络中,输入值<math>x_i</math>也直接被输入至logistic分类器。对我们此前讨论的神经网络示意图稍加更改,即可获得其示意图。其特点在于,第一层的输入节点除了与隐层联接之外,还将越过隐层,与第三层输出节点直接相连)。但是只要开展微调,级联表示相比替代表示几乎没有优势。因此,如果需要开展微调,我们通常在建立替代表示网络(但是如果不开展微调,级联表示的效果有时候会好得多)。
 
-
【一审】
+
使用微调时,初始的非监督特征学习步骤(也就是自动编码器和logistic分类器训练)有时候被称为预训练。微调的作用在于,已标注数据集也可以用来修正权值<math>\textstyle W^{(1)}</math>,这样可以对隐藏单元所提取的特征<math>\textstyle a</math>做进一步调整。
-
到现在为止,我们描述上述过程时,都假设采用了“替代”表示而不是“级联”表示。在替代表示中,logistic分类器所看到的训练样本格式为<math>(a^{(i)}, y^{(i)})</math>;而在级联表示中,分类器所看到的训练样本格式为<math>((x^{(i)}, a^{(i)}), y^{(i)})</math>。对级联表示同样可以开展微调(在级联表示神经网络中,输入值<math>x_i</math>也直接被输入至输出层的logistic分类器。对我们此前讨论的神经网络示意图稍加更改,即可获得其示意图。其特点在于,第一层的输入节点除将越过隐含层,与第三层输出节点直接相连)。但是只要开展微调,级联表示相比替代表示几乎没有优势。因此,如果需要开展微调,我们通常在建立替代表示网络(但是如果不开展微调,级联表示的效果有时候会好得多)。
+
-
【原文】
+
到现在为止,我们描述上述过程时,都假设采用了“替代(Replacement)”表示而不是“级联(Concatenation)”表示。在替代表示中,logistic分类器所看到的训练样本格式为<math>\textstyle (a^{(i)}, y^{(i)})</math>;而在级联表示中,分类器所看到的训练样本格式为<math>\textstyle ((x^{(i)}, a^{(i)}), y^{(i)})</math>。对级联表示同样可以进行微调(在级联表示神经网络中,输入值<math>\textstyle x_i</math>也直接被输入至logistic分类器。对此前的神经网络示意图稍加更改,即可获得其示意图。具体的说,第一层的输入节点除了与隐层联接之外,还将越过隐层,与第三层输出节点直接相连)。但是对于微调来说,级联表示相对于替代表示几乎没有优势。因此,如果需要开展微调,我们通常使用替代表示的网络(但是如果不开展微调,级联表示的效果有时候会好得多)。
-
When should we use fine-tuning? It is typically used only if you have a large labeled training set; in this setting, fine-tuning can significantly improve the performance of your classifier. However, if you have a large unlabeled dataset (for unsupervised feature learning/pre-training) and only a relatively small labeled training set, then fine-tuning is significantly less likely to help.
+
-
【初译】
 
-
应该在什么时候应用微调?通常在拥有大量标注训练数据的情况下应用。在这样的情况下,微调能显著提升分类器性能。但是,如果你拥有大量未标注数据集(可用以非监督特征学习/预训练)和相对而言少量标注训练集,微调的作用有限。
 
-
【一审】
+
在什么时候应用微调?通常仅在有大量已标注训练数据的情况下使用。在这样的情况下,微调能显著提升分类器性能。然而,如果有大量未标注数据集(用于非监督特征学习/预训练),却只有相对较少的已标注训练集,微调的作用非常有限。
-
应该在什么时候应用微调?通常在拥有大量标注训练集的情况下应用。在这样的情况下,微调能显著提升分类器性能。但是,如果你拥有大量未标注数据集(可用以非监督特征学习/预训练)和相对而言少量标注训练集,微调的作用有限。
+

Revision as of 10:25, 16 March 2013

Personal tools