How to plot performance graph after CNN training

5 ビュー (過去 30 日間)
Satyabrata Nath
Satyabrata Nath 2017 年 3 月 23 日
回答済み: Parag 2025 年 3 月 7 日
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)

回答 (1 件)

Parag
Parag 2025 年 3 月 7 日
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.

カテゴリ

Help Center および File ExchangeRecognition, Object Detection, and Semantic Segmentation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by