MonitorLogger
Description
Use a MonitorLogger object to log data to a monitor window,
within the train function or
inside a custom training loop. To log data when using the train function, specify appropriate
callback functions in MonitorLogger, as shown in the examples. These
callbacks are executed at different stages of training, for example,
EpisodeFinishedFcn is executed after the completion of an episode. The
output of a callback function is a structure containing the data to log at that stage of
training.
Note
Using a MonitorLogger object to log data when using the train function does
not affect (and is not affected by) any option to save agents during training specified
within a training options object.
Note
When using a MonitorLogger object to log data using a built-in training
function and no data is available to be logged for an episode, then no data for that episode
will be sent to the monitor window. For example, if you are logging the training losses
using the AgentLearnFinishedFcn callback then data is created only for
only the episodes in which that the agent learn. If, for example, the first episode does not
contain an adequate number of steps for the agent to learn, then no data is sent to the
monitor window for that episode.
Note
MonitorLogger is an handle object. If you assign an existing
MonitorLogger object to a new MonitorLogger object, both
the new object and the original one refer to the same underlying object in memory. To
preserve the original object parameters for later use, save the object to a MAT file. For
more information about handle objects, see Handle Object Behavior.
Creation
Create a MonitorLogger object using rlDataLogger
specifying a trainingProgressMonitor object as input argument.
Properties
Object Functions
Examples
Limitations
Only scalar data is supported when logging data with a
MonitorLoggerobject. The structure returned by the callback functions must contain fields with scalar data.Resuming of training from a previous training result is not supported when logging data with a
MonitorLoggerobject.
Version History
Introduced in R2022b
