Assignment 3: Restricted Boltzmann Machines

Discussion: May 2nd
Deadline: May 1st, 20:00

In this assignment, we will be implementing a Binary RBM. This requires some low-level programming rather than just sticking a bunch of layers together.

For additional assistance, there is a starter notebook on Gitlab, as well as a summary of the exercise board on Mattermost.

Start off by implementing the RBM model and algorithm 18.1 from the deep learning book.

Once you have the basic algorithm going, you might want to test it first. Since we are working with binary RBMs, MNIST seems like the best option here. You may “binarize” the data by rounding all values to 0 or 1, however since MNIST is already almost binary this will likely not make a large difference (still, it is “more correct” to do so). Experiment with different numbers of hidden units and burn-in steps, and generate some samples of the trained models for subjective evaluation.
Note: To get the best results, your Markov chains likely need to run for a few hundred steps each training step! This draws out training quite a bit.

Next, you should improve on the basic procedure.

Test your algorithms once again and compare the results (as well as the speed at which you achieve them) to the basic algorithm. You can probably cut the number of burn-in steps significantly (say, 5-10x fewer).

Bonus

Feel free to try other training methods such as pseudolikelihood or score matching (from optional reading).