trainingProgressMonitor
Monitor and plot training progress for deep learning custom training loops
Since R2022b
Description
Use a TrainingProgressMonitor
object to track training progress
when using a custom training loop.
You can use a TrainingProgressMonitor
object to:
Create animated custom metric plots and record custom metrics during training.
Display and record training information during training.
Stop training early.
Track training progress with a progress bar.
Track elapsed time.
This image shows an example of the Training Progress window during training. For more information about configuring the Training Progress window and an example showing how to generate this figure, see Monitor Custom Training Loop Progress.
Creation
Description
creates a
monitor
= trainingProgressMonitorTrainingProgressMonitor
object that you can use to track the training
progress and create training plots.
Properties
Object Functions
groupSubPlot | Group metrics in training plot |
recordMetrics | Record metric values for custom training loops |
updateInfo | Update information values for custom training loops |
yscale | Set training plot y-axis scale (linear or logarithmic) |
Examples
Tips
The information values appear in the Training Progress window and the training plot shows a record of the metric values. Use information values for text and for numerical values that you want to display in the training window but not in the training plot.
When you click the Stop button in the Training Progress window, the
Stop
property is set to1
(true
). This stops training if your training loop exits when theStop
property is1
. For example, to enable early stopping, include the following code in your custom training loop.while numEpochs < maxEpochs && ~monitor.Stop % Custom training loop code. end
The elapsed time updates each time you call
recordMetrics
orupdateInfo
, and when you update theProgress
property.
Version History
Introduced in R2022b