how to train an autoencoder without trainAutoencoder function?

16 ビュー (過去 30 日間)
taiyo hasegawa
taiyo hasegawa 2018 年 9 月 7 日
回答済み: taiyo hasegawa 2018 年 9 月 8 日
I what train an autoencoder without trainAutoencoder function.
Then I got some problems.
The learning of the network stopped at a certain value, and the output image was different from the input.
Despite the nodes of the hidden layer being larger than the input size.
I must have overlooked, but I can not consider it.
The code and output.
rng('default')
% Load the training data into memory
[xTrainImages,tTrain] = digitTrainCellArrayData;
N = length(xTrainImages);
hiddenSize = 1000;
%%cell to array(alter cell into vector)
T = zeros(numel(xTrainImages),28*28);
for i = 1:numel(xTrainImages)
T(i,:) = xTrainImages{i}(:)';
end
X = T';
T = T';
%%neural networks setting and training
net = fitnet(hiddenSize);
net.trainFcn = 'trainscg';
net = configure(net,X,T);
net = train(net,X,T);
%%denoising images
h1 = figure;
h2 = figure;
figure(h1)
for i = 1:20
subplot(4,5,i);
imshow(xTrainImages{i})
end
figure(h2);
for i = 1:20
subplot(4,5,i);
imshow(reshape(net(xTrainImages{i}(:)),28,28));
end

採用された回答

taiyo hasegawa
taiyo hasegawa 2018 年 9 月 8 日
I solved it after sparse learning.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by