Sample images in MNIST database



The digit image can be displayed in matlab with the following command lines:

%===========================================
idx = randperm(4000);
fea = fea(idx(1:100),:);

faceW = 28;
faceH = 28;
numPerLine = 20;
ShowLine = 4;

Y = zeros(faceH*ShowLine,faceW*numPerLine);
for i=0:ShowLine-1
   for j=0:numPerLine-1
     Y(i*faceH+1:(i+1)*faceH,j*faceW+1:(j+1)*faceW) = reshape(fea(i*numPerLine+j+1,:),[faceH,faceW])';
   end
end

imagesc(Y);colormap(gray);
%===========================================