Using the MNIST Dataset

From Ufldl

Jump to: navigation, search
(Created page with "=== Introduction === The MNIST dataset is a dataset of handwritten digits, comprising 60 000 training exmaples and 10 000 test examples. The dataset can be downloaded from http:...")
Line 57: Line 57:
As an example of how to use these functions, you can check the images and labels using the following code:
As an example of how to use these functions, you can check the images and labels using the following code:
<syntaxhighlight>
<syntaxhighlight>
 +
% Change the filenames if you've saved the files under different names
images = loadMNISTImages('train-images-idx3-ubyte');
images = loadMNISTImages('train-images-idx3-ubyte');
labels = loadMNISTLabels('train-labels-idx1-ubyte');
labels = loadMNISTLabels('train-labels-idx1-ubyte');
-
% where we are using display_network from the autoencoder code
+
% We are using display_network from the autoencoder code
display_network(reshape(images,28 * 28,[]));
display_network(reshape(images,28 * 28,[]));
disp(labels(1:10));
disp(labels(1:10));
</syntaxhighlight>
</syntaxhighlight>

Revision as of 23:50, 30 March 2011

Personal tools