RBMs belong to a class of energy-based models. These use a free energy equation that is analogous to the cost function in other machine learning algorithms. Just like a cost function, the objective is to minimize the free energy values. A lower free energy value equates to a higher probability that the visible unit variables are being described by the hidden units and a higher value equates to a lower likelihood.
Let's now look at the three models we just created and compare free energy values for these models. We compare the free energy to identify which model is performing better by running the following code:
rbm5$e[1:10]
rbm3$e[1:10]
rbm1$e[1:10]
After running this code, an output similar to the following will be printed to your console:
In this case, using just one round of Gibbs sampling produces the best performing model...