How to plot network performance?

3 Ansichten (letzte 30 Tage)
john karli
john karli am 4 Mär. 2022
Beantwortet: Mahesh Taparia am 9 Mär. 2022
I am trying to plot the network performance using following code
[net2,tr] = trainNetwork(augimdsTrain,lgraph,options);
figure
plot(tr.TrainingLoss,'b-')
hold on
x = 1 : length(tr.ValidationLoss);
y = tr.ValidationLoss;
idx = ~any(isnan(y),1);
plot(x(idx),y(idx),'--k','Marker','.','MarkerSize' ,12);
plotperf(tr)
but got the following error
Unrecognized field name "num_epochs".
Error in plotperform>update_plot (line 258)
numEpochs = tr.num_epochs;
Error in plotperform (line 109)
plotData = update_plot(param,fig,plotData,update_args{:});
my tr variable have
>> tr
tr =
struct with fields:
TrainingLoss: [1×9187 double]
TrainingAccuracy: [1×9187 double]
ValidationLoss: [1×9187 double]
ValidationAccuracy: [1×9187 double]
BaseLearnRate: [1×9187 double]
FinalValidationLoss: 0.0322
FinalValidationAccuracy: 99.6214

Antworten (2)

yanqi liu
yanqi liu am 7 Mär. 2022
PLOTPERF Plot network performance.
the tr get by train not trainNetwork,so may be should plot perf by self,such as use plotroc(targets,outputs)
  2 Kommentare
john karli
john karli am 7 Mär. 2022
what is the targets and outputs in plotroc?
yanqi liu
yanqi liu am 7 Mär. 2022
targets:real label for test data
outputs:predict label for test data

Melden Sie sich an, um zu kommentieren.


Mahesh Taparia
Mahesh Taparia am 9 Mär. 2022
Hi
You can select the 'Plots' name value pair of trainingOptions function to 'training-progress' and then train the network. You will be able to see the training plot, and you can export and save that. For more information, you can refer this documentation.
Hope it helps!

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!

Translated by