In this recipe, we will learn how to first stack RBMs to make a DBN, and then train it to detect emotions. The interesting part of the recipe is that we employ two different learning paradigms: first, we pretrain RBMs one by one using unsupervised learning, and then, in the end, we have an MLP layer, which is trained using supervised learning.
DBN for Emotion Detection
Getting ready
We use the RBM class we have already created in the recipe Restricted Boltzmann Machine, with just one change, we do not need to reconstruct the image after training now. Instead, our stacked RBMs will be only forward passing the data up to the last MLP layer of DBN. This is achieved by removing the reconstruct() function from the class, and replacing...