Permalink
Browse files

Changed disp()'s to printf()'s in example files (where it hadn't been…

… done before).
  • Loading branch information...
1 parent 50df028 commit df2ed92bab280bcf1b6de9fdbce9cc36296a3e37 @carlcotner carlcotner committed Mar 7, 2012
Showing with 8 additions and 4 deletions.
  1. +6 −3 NN/nnexamples.m
  2. +2 −1 SAE/saeexamples.m
View
9 NN/nnexamples.m
@@ -20,7 +20,8 @@
nn = nntrain(nn, train_x, train_y, opts);
[er, bad] = nntest(nn, test_x, test_y);
-disp([num2str(er * 100) '% error']);
+%disp([num2str(er * 100) '% error']);
+printf('%5.2f% error', 100 * er)
figure; visualize(nn.W{1}', 1) % Visualize the weights
%% ex2: Using 100-50 hidden units, learn to recognize handwritten digits
@@ -34,7 +35,8 @@
nn = nntrain(nn, train_x, train_y, opts);
[er, bad] = nntest(nn, test_x, test_y);
-disp([num2str(er * 100) '% error']);
+%disp([num2str(er * 100) '% error']);
+printf('%5.2f% error', 100 * er)
figure; visualize(nn.W{1}', 1) % Visualize the weights
%% ex3: Train a denoising autoencoder (DAE) and use it to initialize the weights for a NN
@@ -65,6 +67,7 @@
[er, bad] = nntest(nn, test_x, test_y);
-disp([num2str(er * 100) '% error']);
+%disp([num2str(er * 100) '% error']);
+printf('%5.2f% error', 100 * er)
figure; visualize(DAE.W{1}', 1) % Visualize the DAE weights
figure; visualize(nn.W{1}', 1) % Visualize the NN weights
View
3 SAE/saeexamples.m
@@ -41,5 +41,6 @@
nn = nntrain(nn, train_x, train_y, opts);
[er, bad] = nntest(nn, test_x, test_y);
-disp([num2str(er * 100) '% error']);
+%disp([num2str(er * 100) '% error']);
+printf('%5.2f% error', 100 * er);
figure; visualize(nn.W{1}', 1) % Visualize the weights

0 comments on commit df2ed92

Please sign in to comment.