Options for initializing reinforcement learning agents
rlAgentInitializationOptions object to specify
initialization options for an agent. To create an agent, use the specific agent creation
function, such as
returns a default options object for initializing a reinforcement learning agent that
supports default networks. Use the initialization options to specify agent initialization
parameters, such as the number of units for each hidden layer of the agent networks and
whether to use a recurrent neural network.
initOpts = rlAgentInitializationOptions
NumHiddenUnit— Number of units in each hidden fully connected layer
256(default) | positive integer
Number of units in each hidden fully connected layer of the agent networks, except for the fully connected layer just before the network output, specified as a positive integer. The value you set also applies to any LSTM layers.
UseRNN— Flag to use recurrent neural network
Flag to use recurrent neural network, specified as a logical.
If you set
true, during agent
creation the software inserts a recurrent LSTM layer with the output mode set to
sequence in the output path of the agent networks. Policy gradient and actor-critic
agents do not support recurrent neural networks. For more information on LSTM, see Long Short-Term Memory Networks.
|Actor-critic reinforcement learning agent|
|Policy gradient reinforcement learning agent|
|Deep deterministic policy gradient reinforcement learning agent|
|Deep Q-network reinforcement learning agent|
|Proximal policy optimization reinforcement learning agent|
|Twin-delayed deep deterministic policy gradient reinforcement learning agent|
|Soft actor-critic reinforcement learning agent|
|Trust region policy optimization reinforcement learning agent|
Create an agent initialization options object, specifying the number of hidden neurons and use of a recurrent neural network.
initOpts = rlAgentInitializationOptions('NumHiddenUnit',64,'UseRNN',true)
initOpts = rlAgentInitializationOptions with properties: NumHiddenUnit: 64 UseRNN: 1
You can modify the options using dot notation. For example, set the agent sample time to
initOpts.NumHiddenUnit = 128
initOpts = rlAgentInitializationOptions with properties: NumHiddenUnit: 128 UseRNN: 1