【发布时间】:2022-01-14 05:21:15
【问题描述】:
我想在 mnist 数据集上训练自动编码器以生成与输入相似的图像。这是我找到的代码:
% Load the training data.
XTrain = digitTrainCellArrayData;
%%
% Train an autoencoder with a hidden layer containing 50 neurons.
hiddenSize = 50;
autoenc = trainAutoencoder(XTrain,hiddenSize,...
'MaxEpochs', 200, ...
'L2WeightRegularization', 10^(-3),...
'SparsityRegularization',1,...
'SparsityProportion',0.45);
% Load the test data.
XTest = digitTestCellArrayData;
% Reconstruct the test image data using the trained autoencoder.
xReconstructed = predict(autoenc, XTest);
现在我想以某种方式评估我的自动编码器的性能,但我不知道该怎么做。我发现here 可以在真实数据集和重建数据集之间使用 MSE。但是,当我尝试这样做时:
mse(XTest - xReconstructed)
我得到错误
Operator '-' is not supported for operands of type 'cell'.
如何使用 mse 正确执行此自动编码器的评估?
【问题讨论】:
标签: matlab deep-learning neural-network autoencoder