Skip to content

phexyz/Restricted_Boltzmann_Machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Restricted Boltzmann Machine

This project builds a RMB. For reference to the underlying mathematics, see https://github.com/XingyuHe/Restricted_Boltzmann_Machine/blob/master/summary.pdf

How to use the model

Install required packages

tensorflow, numpy, time, os, matplotlib

sh requirements.sh

How to use

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()

Results

Number GIF
0 alt text
1 alt text
2 alt text
3 alt text
4 alt text
5 alt text
6 alt text
7 alt text
8 alt text
9 alt text

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. alt text

About

Training The Restricted Boltzmann Machine with Contrastive Divergence

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors