I want to implement Gaussian RBM.For that i want to make zero mean and unit variance of data.my data is MNIST dataset.The dataset has been taken and followed from the following link.
Visit http://www.cs.toronto.edu/~hinton/code/makebatches.m
so i implemented in below way.But my data become NAN.It becomes NAN after dividing the data with standard deviation.
for epoch = epoch:maxepoch,
fprintf(1,'epoch %d \r',epoch);
errsum=0;
for batch = 1:numbatches,
fprintf(1,'epoch %d batch %d \r',epoch,batch);
%START POSITIVE PHASE
data = batchdata(:,:,batch);
% zero mean and unit variance
data_mean = mean(data,1);
data=bsxfun(@minus,data,data_mean);
data_std = std(data1,[],1);
data=bsxfun(@rdivide,data,data_std);
I tried this with small set of examples.It works well.What will be the reason to become NAN.
How to get rid of this and make Gaussian input with zero mean and unit variance.