n>
<span class="comment">% the correct label of example i. Then, create trainLabels by:</span>
<span class="comment">%   fid = fopen(trainLabels,'wb'); fwrite(fid,Y(:),'ubit1'); fclose(fid);</span>
</pre><h2>Decide if you want GPU or CPU implementation<a name="2"></a></h2><pre class="codeinput">atGPU = false; <span class="comment">% change this to true if you have a GPU and Matlab parallel toolbox</span>
</pre><h2>Define the architecture of a network (the LeNet architecture)<a name="3"></a></h2><p>the archi