mnist-matlab
mnist-matlab copied to clipboard
MNIST Database of Handwritten Digits for MATLAB
MNIST database of handwritten digits in MATLAB format
This repository provides a simple conversion function of the original MNIST dataset into MATLAB .mat
format for easy usage. Be sure to also pull the submodules containing the original MNIST dataset.
In order to convert the data, execute
convertMNIST
once in this directory, which will create mnist.mat
. After that, you can use
load('mnist.mat')
which will load two variables into your workspace:
-
training
, which contains the training set and -
test
, which contains the test set.
Both variables are represented as structures of the following fields:
-
count
: The numberN
of images -
width
: The widthW
of each image -
height
: The heightH
of each image -
images
: AH
byW
byN
array of all images -
labels
: An array ofN
values describing the image label
The images
are encoded as doubles with a range of 0
..1
, where 0
is background and 1
is foreground. The original MNIST dataset interprets these as 0
for white and 1
for black.
The labels
field is encoded as categorical double values in the range of 0
through 9
inclusive.