Answers.Body: <p>One of the big realizations that deep learning models brought in recent years was that we can train the feature extractors and classifiers simultaneously. In fact most people have stopped separating the 2 tasks and simply refer to all the process as training the model. </p>
  
  <p>However, if you dive in to every single model architecture, it will always be constructed from the first part which is the <strong>feature extractor</strong> which outputs the embedding output - (which is basically the x encoded features of the input), and second part consisting of the final layer the model - <strong>the classifier</strong> which uses the embedding layer encoding to predict the class of the input.</p>
  
  <p>The goal of the first part is to reduce the dimensionality of the input to just the most impotent features for the final task. The goal of the classifier is to use those features to output the final score/class etc.</p>
  
  <p>This is why usually only this layer is fine-tuned, because we don't want to damage the trained feature extractor, just update the classifier to fit a slightly different distribution.</p>
  
  <p>I'm pretty sure that in your mentioned case, for generation they do not use the classification layer, so updating it shouldn't have any affect on the model's generative abilities.</p>
  
  <p>Regarding your last question, yes it is possible, ones you extracted the features with the model, you can use any kind of classifier on them.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-12T11:20:17.967Z
Answers.LastActivityDate: 2019-01-12T11:20:17.967Z
Answers.UserDisplayName: Mark.F
Body: <p>I understand why deep generative models like  DBN ( deep belief nets ) or DBM ( deep boltzmann machines ) are able to capture underlying structures in data and use it for various tasks ( classification, regression, multimodal representations etc ...).</p>
  
  <p>But for the classification tasks like in <a href="http://www.cs.cmu.edu/~rsalakhu/papers/annrev.pdf" rel="nofollow noreferrer">Learning deep generative models</a>, I was wondering why the network is fine-tuned on labeled-data like a feed-forward network and why only the last hidden layer is used for classification?</p>
  
  <p>During the fine-tuning and since we are updating the weights for a classification task ( not the same goal as the generative task ), could the network lose some of its ability to regenerate proper data? ( and thus to be used for different classification tasks ? )</p>
  
  <p>Instead of using only the last layer, could it be possible to use a partition of the hidden units of different layers to perform the classifications task and without modifying the weights? For example, by taking a subset of hidden units of the last two layers ( sub-set of abstract representations ) and using a simple classifier like an SVM?</p>
  
  <p>Thank you in advance!</p>
  
Tags: <machine-learning><deep-learning><classification><generative-model>
Title: Why is the last layer of a DBN or DBM used for classification task?
UserDisplayName: Ravid
ThreadText: # Why is the last layer of a DBN or DBM used for classification task?
  
  (Asked by: username_0 on 2019-01-11)
  
  I understand why deep generative models like DBN ( deep belief nets ) or DBM ( deep boltzmann machines ) are able to capture underlying structures in data and use it for various tasks ( classification, regression, multimodal representations etc ...).
  
  But for the classification tasks like in [Learning deep generative models](http://www.cs.cmu.edu/~rsalakhu/papers/annrev.pdf), I was wondering why the network is fine-tuned on labeled-data like a feed-forward network and why only the last hidden layer is used for classification?
  
  During the fine-tuning and since we are updating the weights for a classification task ( not the same goal as the generative task ), could the network lose some of its ability to regenerate proper data? ( and thus to be used for different classification tasks ? )
  
  Instead of using only the last layer, could it be possible to use a partition of the hidden units of different layers to perform the classifications task and without modifying the weights? For example, by taking a subset of hidden units of the last two layers ( sub-set of abstract representations ) and using a simple classifier like an SVM?
  
  Thank you in advance!
  
  **Tags:** machine-learning, deep-learning, classification, generative-model
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-01-12. Score: 1
  
  One of the big realizations that deep learning models brought in recent years was that we can train the feature extractors and classifiers simultaneously. In fact most people have stopped separating the 2 tasks and simply refer to all the process as training the model.
  
  However, if you dive in to every single model architecture, it will always be constructed from the first part which is the **feature extractor** which outputs the embedding output - (which is basically the x encoded features of the input), and second part consisting of the final layer the model - **the classifier** which uses the embedding layer encoding to predict the class of the input.
  
  The goal of the first part is to reduce the dimensionality of the input to just the most impotent features for the final task. The goal of the classifier is to use those features to output the final score/class etc.
  
  This is why usually only this layer is fine-tuned, because we don't want to damage the trained feature extractor, just update the classifier to fit a slightly different distribution.
  
  I'm pretty sure that in your mentioned case, for generation they do not use the classification layer, so updating it shouldn't have any affect on the model's generative abilities.
  
  Regarding your last question, yes it is possible, ones you extracted the features with the model, you can use any kind of classifier on them.
  
  
  ---
  
  