/ul></div><h2>data preparation<a name="1"></a></h2><p>we need 4 files</p><pre class="codeinput">trainImages = <span class="string">'data/train.images.bin'</span>;
trainLabels = <span class="string">'data/train.labels.bin'</span>;
testImages = <span class="string">'data/test.images.bin'</span>;
testLabels = <span class="string">'data/test.labels.bin'</span>;
<span class="comment">% The format is as follows</span>
<span class="comment">% Suppose X is a 4 dim matlab array with dimensions 28x28x1x60000,</span>
