(squeeze(x(:,:,:,i))'); colormap gray; axis off; title(sprintf('%d',bla(i)-1));  end


%% Train using SGD with Nesterov's momentum
% mandatory fields
T = 1000; mu = single(0.9); printIter = 100; lam =  single(0.0005); 
learning_rate = @(t)(0.01*(1+0.0001*t)^(-0.75)); % learning rate rule
% optional fields
param.snapshotFile = '/tmp/snapshot'; param.printIter = 100; param.printDecay = 0.9;
% call Nesterov
cnn.Nesterov(T,learning_rate,mu,lam,param);
% plot convergence
figure; plot(cnn.AllLoss'); title('Nester