How to change plotting options in deep learning networks?
Show older comments
I have trained a deep learning network, and the training progress graph appeared from trainNetwork function. This curve shows training accuracy, smoothed training accuracy, and validation accuracy. I need to remove smoothed training accuracy curve from the graph. Could you please help me? https://ch.mathworks.com/help/deeplearning/ref/trainingoptions.html?fbclid=IwAR0zK3F4pzPV_DqbAkRk_Ou7CmN3viJMXVx-ovnEmLfvc_M8dNWw3vZvMPs
Answers (1)
Jaynik
on 28 Jun 2024
Hi,
There is no direct way to remove the smoothed training accuracy curve from the graph. If possible, you can upgrade MATLAB and use the "trainnet" function introduced in R2023a. The plots don't provide the smoothed accuracy. Since R2024a, the "trainNetwork" function is not recommended.
Alternately, if it is possible to use custom loops for training the data, you can use the "trainingProgressMonitor" object. It allows for creating animated custom metric plots and record custom metrics during training. Following is an example of using "trainingProgressMonitor":
monitor = trainingProgressMonitor;
addMetrics(monitor, ["TrainingAccuracy", "ValidationAccuracy"]);
% Training loop example
for epoch = 1:numEpochs
% Perform training and validation steps here
% Update custom metrics
recordMetrics(monitor, epoch, ["TrainingAccuracy", trainingAccuracy, "ValidationAccuracy", validationAccuracy]);
end
% Display the training progress monitor
show(monitor);
You can refer the following documentation links to learn about these functions:
- trainnet: https://www.mathworks.com/help/deeplearning/ref/trainnet.html
- trainingProgressMonitor: https://www.mathworks.com/help/deeplearning/ref/deep.trainingprogressmonitor.html
Hope this helps!
Categories
Find more on Deep Learning Toolbox 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!