how to train an autoencoder without trainAutoencoder function?

조회 수: 16 (최근 30일)
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 CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by