www.gusucode.com > RBM > RBM/xample.m

    close all
clear all;
clc
x=imread('70.jpg');
imresize(x,[40 40]);
x=rgb2gray(x);
x=double(x);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
maxittre=100;    % maximum number of learning itterations
NG=10;           % number of gibbs samplling steps
Nneurons=1600;   % number of neurons in the hidden layer
eps=0.01;        % learning rate
[net]=RBM_TB(x,eps,Nneurons,maxittre,NG);% training
subplot(221)
imshow(net.regen)
title('regenerated input')
subplot(222)
imshow(net.input)
title('original input')
subplot(2,2,3:4)
plot(1:length(net.hist),net.hist,'LineWidth',2)
xlabel('number of iterations')
ylabel('RMSE of training')
grid
net.Tr_acc