_labels: [60000x1 uint8]</span>
  <span class="comment">%   test_labels: [10000x1 uint8]</span>
  h = 28; w = 28; d= h*w;
  ndx = randperm(10000); <span class="comment">% random classes</span>
  ndx = ndx(1:1000); n = length(ndx);
  X = double(reshape(mnist.train_images(:,:,ndx),[d n]))';
<span class="keyword">end</span>


<span class="comment">% Visualize a random subset of the data as a single image</span>
perm = randperm(n);
figure(1); clf
<span class="comment">%K = 24; %XX = reshape(X(perm(1:K),:)', [h 