groupSubPlot - Group metrics in experiment training plot - MATLAB (original) (raw)

Group metrics in experiment training plot

Since R2021a

Syntax

Description

groupSubPlot([monitor](#function%5FgroupSubPlot%5Fsep%5Fmw%5Fed461b10-1b62-4703-ab9c-ec1d5b1cf6d9),[groupName](#mw%5Fbcbbf4e8-d85a-45c4-81df-890c94429e5e),[metricNames](#mw%5F489d4a3e-cb1c-4e72-8247-f046e31748fb)) groups the specified metrics in a single training subplot with the y-axis labelgroupName. By default, Experiment Manager plots each ungrouped metric in its own training subplot.

To group metrics, all metrics must have the same y-axis scale. For more information, seeyscale.

example

Examples

collapse all

Track Experiment Progress, Display Information and Record Metric Values, and Produce Training Plots

Use an experiments.Monitor object to track the progress of the training, display information and metric values in the experiment results table, and produce training plots for custom training experiments.

Before starting the training, specify the names of the information and metric columns of the Experiment Manager results table.

monitor.Info = ["GradientDecayFactor","SquaredGradientDecayFactor"]; monitor.Metrics = ["TrainingLoss","ValidationLoss"];

Specify the horizontal axis label for the training plot. Group the training and validation loss in the same subplot.

monitor.XLabel = "Iteration"; groupSubPlot(monitor,"Loss",["TrainingLoss","ValidationLoss"]);

Specify a logarithmic scale for the loss. You can also switch the y-axis scale by clicking the log scale button in the axes toolbar.

yscale(monitor,"Loss","log")

Update the values of the gradient decay factor and the squared gradient decay factor for the trial in the results table.

updateInfo(monitor, ... GradientDecayFactor=gradientDecayFactor, ... SquaredGradientDecayFactor=squaredGradientDecayFactor);

After each iteration of the custom training loop, record the value of training and validation loss for the trial in the results table and the training plot.

recordMetrics(monitor,iteration, ... TrainingLoss=trainingLoss, ... ValidationLoss=validationLoss);

Update the training progress for the trial based on the fraction of iterations completed.

monitor.Progress = 100 * (iteration/numIterations);

Input Arguments

collapse all

monitor — Experiment monitor

experiments.Monitor object

Experiment monitor for the trial, specified as an experiments.Monitor object. When you run a custom training experiment, Experiment Manager passes this object as the second input argument of the training function.

groupName — Name of subplot group

string | character vector

Name of subplot group, specified as a string or character vector. Experiment Manager groups the specified metrics in a single training subplot with the y-axis labelgroupName.

Data Types: char | string

metricNames — Metric names

string | character vector | string array | cell array of character vectors

Metric names, specified as a string, character vector, string array, or cell array of character vectors. Each metric name must be an element of theMetrics property of the experiments.Monitor object monitor.

Data Types: char | string

Tips

Version History

Introduced in R2021a