This project builds a RMB. For reference to the underlying mathematics, see https://github.com/XingyuHe/Restricted_Boltzmann_Machine/blob/master/summary.pdf
tensorflow, numpy, time, os, matplotlib
sh requirements.sh
Example is in main.py. In a python file
Extract MNIST data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
Create a Restricted Boltzmann Machine with MNIST training data
rbm = RBM(num_visible=784, num_hidden=10,
train_data=mnist.train.images, epochs=20,
learning_rate=0.00001)
Train the Restricted Boltzmann Machine with the training data
rbm.train()
| Number | GIF |
|---|---|
| 0 | ![]() |
| 1 | ![]() |
| 2 | ![]() |
| 3 | ![]() |
| 4 | ![]() |
| 5 | ![]() |
| 6 | ![]() |
| 7 | ![]() |
| 8 | ![]() |
| 9 | ![]() |
We can also think of the hidden units as the
features extracted from the hidden layer units.
The following GIF demonstrates that the values
of the hidden units (each row in the picture)
for each number (0-9) tend to converge values
that are unique from the values of other hidden
units (other rows in the picture). The patterns
in each row are different enough such that if
provided with labels on the images, a logistic
classifier can differentiate between each digit.










