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


댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!