@@ -70,7 +70,7 @@ opts.momentum = 0;
7070opts.alpha = 1;
7171dbn = dbnsetup(dbn, train_x, opts);
7272dbn = dbntrain(dbn, train_x, opts);
73- figure; visualize(dbn.rbm{1}.W', 1 ); % Visualize the RBM weights
73+ figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights
7474
7575%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NN
7676rng(0);
@@ -94,6 +94,7 @@ nn = nntrain(nn, train_x, train_y, opts);
9494[er, bad] = nntest(nn, test_x, test_y);
9595
9696assert(er < 0.12, 'Too big error');
97+
9798```
9899
99100
@@ -118,7 +119,7 @@ sae.ae{1}.inputZeroMaskedFraction = 0.5;
118119opts.numepochs = 1;
119120opts.batchsize = 100;
120121sae = saetrain(sae, train_x, opts);
121- visualize(sae.ae{1}.W{1}', 1 )
122+ visualize(sae.ae{1}.W{1}')
122123
123124% Use the SDAE to initialize a FFNN
124125nn = nnsetup([784 100 10]);
@@ -132,6 +133,7 @@ opts.batchsize = 100;
132133nn = nntrain(nn, train_x, train_y, opts);
133134[er, bad] = nntest(nn, test_x, test_y);
134135assert(er < 0.21, 'Too big error');
136+
135137```
136138
137139
0 commit comments