ackage on the MNIST data set
% 

%% data preparation
% we need 4 files
trainImages = 'data/train.images.bin';
trainLabels = 'data/train.labels.bin';
testImages = 'data/test.images.bin';
testLabels = 'data/test.labels.bin';
% The format is as follows
% Suppose X is a 4 dim matlab array with dimensions 28x28x1x60000, 
% where X(:,:,1,j) is the j'th image
% Suppose that X are numbers between 0 and 255.
% Then, create trainImages by
%   fid = fopen(trainImages,'wb'); fwrite(fid,X(:),'uint8'); fclose(fid);
% To 