where are the initial weights and biases when training autoencoder?,
Show older comments
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?
Accepted Answer
More Answers (0)
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!