- Ensure the network is set up for classification: Use a softmax layer and a classification layer.
- Specify accuracy as a metric: Use the trainingOptions function to specify accuracy as a metric.
training network plot accuracy intead of rmse
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
hello everyone
I am using LSTM for data prediction and I use trainNetwork for it but When I run my cde the training plot only plots rmse and I want to plot accuracy ?
Here is my layers and Option what sholud I do ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1268420/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1268420/image.png)
numResponses = 1 ;
featureDimension =1;
numHiddenUnits =200;
layers = [ ...
sequenceInputLayer(featureDimension)
lstmLayer(numHiddenUnits)
fullyConnectedLayer(numResponses)
regressionLayer
];
maxepochs = 500;
miniBatchSize = 45 ;
options = trainingOptions('adam', ... %%adam
'MaxEpochs',maxepochs, ...
'GradientThreshold',1, ...
'Shuffle','every-epoch', ...
'ValidationData',{XVal_ZaMir,YVal_ZaMir}, ...
'ValidationFrequency',25,...
'InitialLearnRate',0.005, ...
'MiniBatchSize',miniBatchSize, ...
'LearnRateSchedule','piecewise', ...
'LearnRateDropPeriod',50, ...
'LearnRateDropFactor',0.1, ...
'Verbose',1, ...
'Plots','training-progress');
0 Kommentare
Antworten (1)
Yash Sharma
am 24 Jul. 2024 um 4:57
To plot accuracy instead of RMSE in the training progress graph when using trainNetwork with LSTM for a classification task, you need to ensure that your network and training options are set up for classification. This involves using a classification layer and specifying accuracy as a metric in the training options.
Here’s how you can do it:
0 Kommentare
Siehe auch
Kategorien
Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!