File Exchange

image thumbnail

Restricted Boltzmann Machine

version 1.4.0 (123 KB) by BERGHOUT Tarek
contrastive divergence for training an RBM is presented in details.

19 Downloads

Updated 29 Apr 2019

View License

Restricted Boltzmann machines (RBMs) are the first neural networks used for unsupervised learning, created by Geoff Hinton (university of Toronto).
The aim of RBMs is to find patterns in data by reconstructing the inputs using only two layers (the visible layer and the hidden layer). By moving forward an RBM translates the visible layer into a set of numbers that encodes the inputs, in backward pass it takes those set of numbers and translates them to the visible layer to regenerate the inputs.
In this code we introduce to you very simple algorithms that depend on contrastive divergence training. The details of this method are explained step by step in the comments inside the code.
For any information please contact me via: berghouttarek@gmail.com
To learn about RBM :
https://www.youtube.com/watch?v=p4Vh_zMw-HQ&feature=youtu.be

Cite As

BERGHOUT Tarek (2019). Restricted Boltzmann Machine (https://www.mathworks.com/matlabcentral/fileexchange/71212-restricted-boltzmann-machine), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Thank you very much for your code

I have some doubt about no of visible neurons.
1.) Actually according to Prof Hinton's paper "Training product of experts" , no of visible neurons depends on dimensions of image like if 28*28 pixel image then the no of visible neurons will be 784.

2.) Secondly, in this code we used I(j,:) as no of visible neurons in gibbs sampling.
That means j varies from 1 to no of gibbs sampling defined.

If j is 1 then first row of the 28*28 matrix will be selected once and multiplied by weight matrix.

So I am confused how all the dimensions of the image are given to visible neurons.

Can you please help me to understand.

Yours Sincerely
Vikas

Noor Abbas

Updates

1.4.0

In the last version we made a mistake: instead of giving all the samples of the image to visible neurons we used only one sample in each Gibbs sampling; now it is corrected.

1.3.0

new descriptif image

1.2.0

in the last code we trained by mistake the RBM with scalar units in visible and hidden layers, as we change the representation of these units into binary units during training and we'v got a much more improvements in accurcy

MATLAB Release Compatibility
Created with R2013b
Compatible with any release
Platform Compatibility
Windows macOS Linux