How can I train a regression layer using the autoencoder approach
이전 댓글 표시
I am trying to adapt example provided here
Except that I want to replace
softnet = trainSoftmaxLayer(feat2,tTrain,'MaxEpochs',400);
With something similar to this
options = trainingOptions('sgdm','MaxEpochs',20,...'InitialLearnRate',0.0001);
routputlayer = regressionLayer('Name','routput');
trainedROL = trainNetwork(feat2,yTrain,routputlayer,options);
However, I receive the following error:
ERROR: Error using trainNetwork>iAssertXAndYHaveSameNumberOfObservations (line 604)
X and Y must have the same number of observations.
Error in trainNetwork>iParseInput (line 336)
iAssertXAndYHaveSameNumberOfObservations( X, Y );
Error in trainNetwork (line 68)
[layers, opts, X, Y] = iParseInput(varargin{:});
Error in test (line 176)
trainedROL = trainNetwork(feat2,tTrain,routputlayer,options);
How can I modify the algorithm to do regression rather than classification?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Pattern Recognition에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!