where are the initial weights and biases when training autoencoder?,
이전 댓글 표시
For example the autoencoder digits example which came with matlab
[xTrainImages, tTrain] = digittrain_dataset;
clf
for i = 1:20
subplot(4,5,i);
imshow(xTrainImages{i});
end
% Get the number of pixels in each image
imageWidth = 28;
imageHeight = 28;
inputSize = imageWidth*imageHeight;
% Turn the training images into vectors and put them in a matrix
xTrain = zeros(inputSize, numel(xTrainImages));
for i = 1:numel(xTrainImages)
xTrain(:,i) = xTrainImages{i}(:);
end
hiddenSize1 = 100;
% Create the network. You can experiment by changing the number of training
% epochs, and the training function
autoenc1 = feedforwardnet(hiddenSize1);
autoenc1.trainFcn = 'trainscg';
autoenc1.trainParam.epochs = 400;
autoenc1.inputs{1}.processFcns = {};
autoenc1.outputs{2}.processFcns = {};
autoenc1.layers{1}.transferFcn = 'logsig';
autoenc1.layers{2}.transferFcn = 'logsig';
autoenc1.divideFcn = 'dividetrain';
autoenc1.performFcn = 'msesparse';
autoenc1.performParam.L2WeightRegularization = 0.004;
autoenc1.performParam.sparsityRegularization = 4;
autoenc1.performParam.sparsity = 0.15;
% Train the autoencoder
autoenc1 = train(autoenc1,xTrain,xTrain);
Where is the initial weights and biases of the autoencoder before training?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!