I have read several tutorials on training an autoencoder that can then be combined with a classification layer (e.g. softmax layer) for learning a classifier model.
I am trying to build this in keras but I am getting blocked on the part where I take my trained encoder layer that learned a compressed mapping of my input data matrix $X$ and I now combine it with a softmax layer to learn the classification model. How do I train this part? Should I re-use the training set I used to train the autoencoder part only this time I fit on the class labels?
EDIT: To clarify, these are the steps I am taking to train a basic stacked autoencoder with a labeled training and test set:
- Take full training set and train it on itself, with 1 hidden layer and 1 output layer such that the hidden has less neurons than the input features.
- Once the hidden layer in step 1 is trained, it is taken out and connected with a new softmax layer. Here, the training set is used again but is fitted with its labels that were not previously used.
- Following step 2, I can use the model for making predictions on my test set.
Is this correct?