git-svn-id: http://moon:8086/svn/matlab/trunk@91 801c6759-fa7c-4059-a304-17956f83a07c
35 lines
1.1 KiB
Matlab
35 lines
1.1 KiB
Matlab
% Version 1.000
|
|
%
|
|
% Code provided by Ruslan Salakhutdinov and Geoff Hinton
|
|
%
|
|
% Permission is granted for anyone to copy, use, modify, or distribute this
|
|
% program and accompanying programs and documents for any purpose, provided
|
|
% this copyright notice is retained and prominently displayed, along with
|
|
% a note saying that the original programs are available from our
|
|
% web page.
|
|
% The programs and documents are distributed without any warranty, express or
|
|
% implied. As the programs were written for research purposes only, they have
|
|
% not been tested to the degree that would be advisable in any important
|
|
% application. All use of these programs is entirely at the user's own risk.
|
|
|
|
function [err] = mnistdisp(digits);
|
|
% display a group of MNIST images
|
|
col=28;
|
|
row=28;
|
|
|
|
[dd,N] = size(digits);
|
|
imdisp=zeros(2*28,ceil(N/2)*28);
|
|
|
|
for nn=1:N
|
|
ii=rem(nn,2); if(ii==0) ii=4; end
|
|
jj=ceil(nn/2);
|
|
|
|
img1 = reshape(digits(:,nn),row,col);
|
|
img2(((ii-1)*row+1):(ii*row),((jj-1)*col+1):(jj*col))=img1';
|
|
end
|
|
|
|
imagesc(img2,[0 1]); colormap gray; axis equal; axis off;
|
|
drawnow;
|
|
err=0;
|
|
|