주요 콘텐츠

updateInfo

Update information columns in experiment results table

    Description

    updateInfo(monitor,infoName=infoValue) updates the specified information column for a trial in the Experiment Manager results table.

    updateInfo(monitor,infoName1=infoValue1,...,infoNameN=infoValueN) updates multiple information columns for a trial.

    example

    updateInfo(monitor,infoStructure) updates the information columns using the values specified by the structure infoStructure.

    example

    Examples

    collapse all

    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);

    Use a structure to update values of information columns in the results table.

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

    Input Arguments

    collapse all

    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.

    Information column name, specified as a string or character vector. This name must be an element of the Info property of the experiments.Monitor object monitor.

    Data Types: char | string

    Information value, specified as one of these values:

    • numeric scalar

    • string scalar

    • character vector

    • dlarray object scalar

    • numeric vector (since R2026a)

    • string array (since R2026a)

    • cell array of character vectors (since R2026a)

    • dlarray object vector (since R2026a)

    To specify multiple values simultaneously, specify infoValue as a vector of values (since R2026a). Specifying multiple values simultaneously can help speed up the training process. The monitor displays the value of the last element only. Specify multiple values when you want the monitor to store the specified values for later analysis such as creating plots or calculating statistics after training.

    Before R2026a: The infoValue argument value must be scalar or a character vector.

    The type of data must match the type of data already recorded for the infoName argument.

    Information column names and values, specified as a structure. Names must be elements of the Info property of the experiments.Monitor object monitor and can appear in any order in the structure.

    Example: struct(GradientDecayFactor=gradientDecayFactor,SquaredGradientDecayFactor=squaredGradientDecayFactor)

    Data Types: struct

    Tips

    • Both information and metric columns display values in the results table for your experiment. Additionally, the training plot shows a record of the metric values. Use information columns for text and for numerical values that you want to display in the results table but not in the training plot.

    • You can use the information values to perform analysis after training. The monitor stores the information values without step information and only adds information when you call the updateInfo function. If you need the step information to use the values for the analysis, then update the information values at each step.

    Version History

    Introduced in R2021a

    expand all