source: prdatasets/mnist.m

Last change on this file was 150, checked in by bduin, 5 years ago
File size: 1.3 KB
Line 
1%MNIST The MNIST database as a PRTools dataset
2%
3%  [TRAIN,TEST] = MNIST
4%   TRAIN_TEST  = MNIST
5%
6% The MNIST database as supplied by Yann LeCun in PRTools format. It
7% contains of 10 classes of handwritten digits of 28 x 28 pixels.
8% The trainset has 60000 digits and the testset 1000.
9%
10% SEE ALSO <a href="http://prtools.tudelft.nl/prtools/">PRTools Guide</a>, <a href="http://yann.lecun.com/exdb/mnist/">Original Website</a>
11% PRTOOLS, DATASETS, SHOW
12
13
14function varargout = mnist
15
16varargout = cell(1,nargout);
17[varargout{:}] = pr_loadmatfile;
18
19if isempty(varargout{1})
20 
21  a = pr_getdata(['http://prtools.tudelft.nl/prdatafiles/MNIST_train.zip'],42,'mnist_train','',1);
22  b = pr_getdata(['http://prtools.tudelft.nl/prdatafiles/MNIST_test.zip'],[],'mnist_test','',0);
23  % Note that these are datafiles
24  user.desc = ['This is the trainset of MNIST.'];
25  user.link = ['http://yann.lecun.com/exdb/mnist/'];
26  a = setuser(a,user)*datasetm; % convert to dataset
27  user.desc = ['This is the testset of MNIST.'];
28  user.link = ['http://yann.lecun.com/exdb/mnist/'];
29  b = setuser(b,user)*datasetm; % convert to dataset
30  a = setname(a,'MNIST');
31  b = setname(b,'MNIST');
32 
33  % save separate and combined files
34  [varargout{:}] = pr_savematfile(a,b);
35 
36end
Note: See TracBrowser for help on using the repository browser.