Main Content

rlAgentInitializationOptions

Options for initializing reinforcement learning agents

Description

Use therlAgentInitializationOptionsobject to specify initialization options for an agent. To create an agent, use the specific agent creation function, such asrlACAgent.

Creation

Description

initOpts= rlAgentInitializationOptionsreturns 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.

example

initOpts= rlAgentInitializationOptions(Name,Value)creates an initialization options object and sets itspropertiesby using one or more name-value pair arguments.

Properties

expand all

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.

Example:'NumHiddenUnit',64

Flag to use recurrent neural network, specified as a logical.

If you setUseRNNtotrue, 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. Note that policy gradient and actor-critic agents do not support recurrent neural networks. For more information on LSTM, seeLong Short-Term Memory Networks.

Example:'UseRNN',true

Object Functions

rlACAgent Actor-critic reinforcement learning agent
rlPGAgent Policy gradient reinforcement learning agent
rlDDPGAgent Deep deterministic policy gradient reinforcement learning agent
rlDQNAgent Deep Q-network reinforcement learning agent
rlPPOAgent Proximal policy optimization reinforcement learning agent
rlTD3Agent Twin-delayed deep deterministic policy gradient reinforcement learning agent
rlSACAgent Soft actor-critic reinforcement learning agent

Examples

collapse all

Create an agent initialization options object, specifying the number of hidden neurons and use of a recurrent neural network.

initOpts = rlAgentInitializationOptions('NumHiddenUnit',64,'UseRNN',真正的)
initOpts = rlAgentInitializationOptions with properties: NumHiddenUnit: 64 UseRNN: 1

You can modify the options using dot notation. For example, set the agent sample time to0.5.

initOpts.NumHiddenUnit = 128
initOpts = rlAgentInitializationOptions with properties: NumHiddenUnit: 128 UseRNN: 1
Introduced in R2020b
Baidu
map