oweis/data.html
  X = double(data(:,:,3))';
  h = 16; w = 16;
end

if 0
  % use all 10 classes at once - gives hard to interpret bases
  loadData('mnistAll'); % mnist structure
  %train_images: [28x28x60000 uint8]  0 to 255
  %   test_images: [28x28x10000 uint8]
  %  train_labels: [60000x1 uint8]
  %   test_labels: [10000x1 uint8]
  h = 28; w = 28; d= h*w;
  ndx = randperm(10000); % random classes
  ndx = ndx(1:1000); n = length(ndx); 
  X = double(reshape(mnist.train_images(:,:,ndx),[d n]))';
end


% Visua