-
Notifications
You must be signed in to change notification settings - Fork 5
/
demo_small.m
47 lines (36 loc) · 1.01 KB
/
demo_small.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
rng(100,'v5normal');
rng(100,'v5uniform');
warning off
clear all
close all
fprintf(1,'Converting Raw files into Matlab format \n');
ExtractDataVectors_modified;
fprintf(1,'Pretraining a Deep Boltzmann Machine. \n');
makebatches;
[numcases numdims numbatches]=size(batchdata);
%%%%%% Training 1st layer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
numhid=16; maxepoch=10;
fprintf(1,'Pretraining Layer 1 with RBM: %d-%d \n',numdims,numhid);
restart=1;
rbm
%%%%%% Training 2nd layer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
close all
numpen = 16;
maxepoch=10;
fprintf(1,'\nPretraining Layer 2 with RBM: %d-%d \n',numhid,numpen);
restart=1;
makebatches;
rbm_l2
%%%%%% Training two-layer Boltzmann machine %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
close all
numhid = 16;
numpen = 16;
maxepoch=10;
fprintf(1,'Learning a Deep Bolztmann Machine. \n');
restart=1;
makebatches;
dbm_mf
%%%%%% Fine-tuning two-layer Boltzmann machine for classification %%%%%%%%%%%%%%%%%
maxepoch=10;
makebatches;
backprop