create the label file, suppose we have k classes and let Y be a matrix
% with Y(:,i) being all zeros vector except 1 in the position j, where j is
% the correct label of example i. Then, create trainLabels by:
%   fid = fopen(trainLabels,'wb'); fwrite(fid,Y(:),'ubit1'); fclose(fid);


%% Decide if you want GPU or CPU implementation
atGPU = false; % change this to true if you have a GPU and Matlab parallel toolbox

%% Define the architecture of a network (the LeNet architecture)
% the architecture is a cell 