How to plot performance graph after CNN training
5 views (last 30 days)
Show older comments
I am new in deep learning and unable to plot performance graph after training my CNN architecture . My code is as follows :-
opts = trainingOptions('sgdm',
'Momentum', 0.9,
'InitialLearnRate', 0.001,
'LearnRateSchedule', 'piecewise',
'LearnRateDropFactor', 0.1,
'LearnRateDropPeriod', 8,
'L2Regularization', 0.004,
'MaxEpochs', 40,
'MiniBatchSize', 128,
'Verbose', true);
cifar10Net = trainNetwork(trainingImages, trainingLabels, layers, opts);
YTest = classify(cifar10Net, testImages);
accuracy = sum(YTest == testLabels)/numel(testLabels)
0 Comments
Answers (1)
Parag
on 7 Mar 2025
Hi, the current code does not include instructions to plot the performance graph (training progress, accuracy, loss, etc.). However, MATLAB automatically displays the training progress plot by default when using the "trainingOptions" function with the "Plots" property set to "training-progress."
Modify the “trainingOptions” to include the “Plots” parameter:
Please refer to MATLAB code for the same
opts = trainingOptions('sgdm', ...
'Momentum', 0.9, ...
'InitialLearnRate', 0.001, ...
'LearnRateSchedule', 'piecewise', ...
'LearnRateDropFactor', 0.1, ...
'LearnRateDropPeriod', 8, ...
'L2Regularization', 0.004, ...
'MaxEpochs', 40, ...
'MiniBatchSize', 128, ...
'Verbose', true, ...
'Plots', 'training-progress'); % Enable performance graph
This will display a real-time training progress plot, including accuracy, loss, and learning rate changes during training.
0 Comments
See Also
Categories
Find more on Recognition, Object Detection, and Semantic Segmentation 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!