Specify Training Options in Reinforcement Learning Designer
To configure the training of an agent in the Reinforcement Learning Designer app, specify training options on the Train tab.
Specify Basic Options
On the Train tab, you can specify the following basic training options.
|Max Episodes||Maximum number of episodes to train the agent, specified as a positive integer.|
|Max Episode Length||Maximum number of steps to run per episode, specified as a positive integer.|
Training termination condition, specified as one of the following values.
|Stopping Value||Critical value of the training termination condition in Stopping Criteria, specified as a scalar.|
|Average Window Length||Window length for averaging the scores, rewards, and number of steps for the agent when either Stopping Criteria or Save agent criteria specify an averaging condition.|
Specify Additional Options
To specify additional training options, on the Train tab, click More Options.
In the More Training Options dialog box, you can specify the following options.
|Save agent criteria|
Condition for saving agents during training, specified as one of the following values.
|Save agent value||Critical value of the save agent condition in Save agent
criteria, specified as a scalar or |
Folder for saved agents. If you specify a name and the folder does not exist, the app creates the folder in the current working directory.
To interactively select a folder, click Browse.
|Show verbose output||Select this option to display training progress at the command line.|
|Stop on Error||Select this option to stop training when an error occurs during an episode.|
Option to graphically display the training progress in the app, specified
as one of the following values.
Specify Parallel Training Options
To train your agent using parallel computing, on the Train tab, click . Training agents using parallel computing requires Parallel Computing Toolbox™ software. For more information, see Train Agents Using Parallel Computing and GPUs.
To specify options for parallel training, select Use Parallel > Parallel training options.
In the Parallel Training Options dialog box, you can specify the following training options.
|Parallel computing mode|
Parallel computing mode, specified as one of the following values.
|Type of data from workers|
Type of data that workers send to the parallel pool client, specified as one of the following values.
For DQN, DDPG, PPO, SAC and TD3 you must set this option to
|Steps until data is sent|
Number of steps after which workers send data to the client and receive
updated parameters, specified as
|Transfer workspace variables to workers|
Select this option to send model and workspace variables to parallel workers. When you select this option, the parallel pool client (the process that starts the training) sends variables used in models and defined in the MATLAB® workspace to the workers.
|Random seed for workers|
Randomizer initialization for workers, specified as one of the following values.
|Files to attach to parallel pool||Additional files to attach to the parallel pool. Specify names of files in the current working directory, with one name on each line.|
|Worker setup function||Function to run before training starts, specified as a handle to a function having no input arguments. This function is run once per worker before training begins. Write this function to perform any processing that you need prior to training.|
|Worker cleanup function||Function to run after training ends, specified as a handle to a function having no input arguments. You can write this function to clean up the workspace or perform other processing after training terminates.|
The following figure shows an example parallel training configuration the following files and functions.
Data file attached to the parallel pool —
Worker setup function —
Worker cleanup function —