1

我想实现高斯 RBM。为此,我想使数据的均值和单位方差为零。我的数据是 MNIST 数据集。数据集已从以下链接获取并遵循。

访问http://www.cs.toronto.edu/~hinton/code/makebatches.m

所以我以下面的方式实现。但是我的数据变成了 NAN。在将数据除以标准偏差后它变成了 NAN。

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); 

%开始积极阶段

data = batchdata(:,:,batch);

% 零均值和单位方差

data_mean = mean(data,1);
data=bsxfun(@minus,data,data_mean);
data_std = std(data1,[],1);
data=bsxfun(@rdivide,data,data_std);

我用一小部分示例进行了尝试。效果很好。成为 NAN 的原因是什么。

如何摆脱这一点并使高斯输入具有零均值和单位方差。

4

2 回答 2

1

I would recommend normalizing the mean and variance of your data before starting the GBRBM training. This would you'd be able to check the batchdata variable manually in MATLAB workspace. While training a GBRBM, I often see NaN as the training/validation error when my learning rate is too high. It should help to set the learning rate below or equal to 0.001.

于 2014-07-12T06:36:14.317 回答
0

您似乎在“data_std = ...”代码中使用了未定义的变量“data1”,而不是“data”。

于 2013-12-25T20:05:16.093 回答