Policy gradient reinforcement learning agent
The policy gradient (PG) algorithm is a model-free, online, on-policy reinforcement learning method. A PG agent is a policy-based reinforcement learning agent which directly computes an optimal policy that maximizes the long-term reward. The action space can be either discrete or continuous.
For more information on PG agents, see Policy Gradient Agents. For more information on the different types of reinforcement learning agents, see Reinforcement Learning Agents.
creates a policy gradient agent for an environment with the given observation and action
specifications, using default initialization options. The actor and critic
representations in the agent use default deep neural networks built from the observation
specification agent
= rlPGAgent(observationInfo
,actionInfo
)observationInfo
and the action specification
actionInfo
.
creates a policy gradient agent for an environment with the given observation and action
specifications. The agent uses default networks in which each hidden fully connected
layer has the number of units specified in the agent
= rlPGAgent(observationInfo
,actionInfo
,initOpts
)initOpts
object.
Policy gradient agents do not support recurrent neural networks. For more information on
the initialization options, see rlAgentInitializationOptions
.
creates a PG agent with the specified actor network. By default, the
agent
= rlPGAgent(actor
)UseBaseline
property of the agent is false
in
this case.
creates a PG agent and sets the agent
= rlPGAgent(___,agentOptions
)AgentOptions
property to the agentOptions
input argument. Use this syntax after
any of the input arguments in the previous syntaxes.
train | Train reinforcement learning agents within a specified environment |
sim | Simulate trained reinforcement learning agents within specified environment |
getAction | Obtain action from agent or actor representation given environment observations |
getActor | Get actor representation from reinforcement learning agent |
setActor | Set actor representation of reinforcement learning agent |
getCritic | Get critic representation from reinforcement learning agent |
setCritic | Set critic representation of reinforcement learning agent |
generatePolicyFunction | Create function that evaluates trained policy of reinforcement learning agent |
For continuous action spaces, the rlPGAgent
agent does not enforce
the constraints set by the action specification, so you must enforce action space
constraints within the environment.
Deep Network Designer | rlAgentInitializationOptions
| rlPGAgentOptions
| rlStochasticActorRepresentation
| rlValueRepresentation