FileLogger
Description
Use a FileLogger
object to log data to MAT files, within the
train function or inside a custom training loop. To log data when using the train function,
specify appropriate callback functions in FileLogger
, 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 FileLogger
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 option object.
Note
When using a FileLogger
object to log data using a built-in training
function and no data is available to be logged for an episode, then no MAT file for that
episode will be created. 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 MAT file is created for that
episode.
Note
FileLogger
is a handle object. If you assign an existing
FileLogger
object to a new FileLogger
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 FileLogger
object using rlDataLogger
without any input arguments.
Properties
Object Functions
Examples
Limitations
Logging data using the
AgentStepFinishedFcn
callback is not supported when training agents in parallel with the train function.
Version History
Introduced in R2022b