rlDQNAgent
Description
The deep Q-network (DQN) algorithm is a model-free, online, off-policy reinforcement learning method. A DQN agent is a value-based reinforcement learning agent that trains a critic to estimate the return or future rewards. DQN is a variant of Q-learning, and it operates only within discrete action spaces.
For more information, Deep Q-Network (DQN) Agents. For more information on the different types of reinforcement learning agents, see Reinforcement Learning Agents.
Creation
Syntax
Description
Create Agent from Observation and Action Specifications
creates a DQN agent for an environment with the given observation and action
specifications, using default initialization options. The critic in the agent uses a
default vector (that is, multi-output) Q-value deep neural network built from the
observation specification agent
= rlDQNAgent(observationInfo
,actionInfo
)observationInfo
and the action
specification actionInfo
. The ObservationInfo
and ActionInfo
properties of agent
are set to
the observationInfo
and actionInfo
input
arguments, respectively.
creates a DQN agent for an environment with the given observation and action
specifications. The agent uses a default network configured using options specified in
the agent
= rlDQNAgent(observationInfo
,actionInfo
,initOpts
)initOpts
object. For more information on the initialization
options, see rlAgentInitializationOptions
.
Create Agent from Critic
creates a DQN agent with the specified critic network using a default option set for a
DQN agent.agent
= rlDQNAgent(critic
)
Specify Agent Options
creates a DQN agent with the specified critic network and sets the agent
= rlDQNAgent(critic
,agentOptions
)AgentOptions
property to the agentOptions
input argument. Use this syntax after
any of the input arguments in the previous syntaxes..
Input Arguments
Properties
Object Functions
train | Train reinforcement learning agents within a specified environment |
sim | Simulate trained reinforcement learning agents within specified environment |
getAction | Obtain action from agent, actor, or policy object given environment observations |
getActor | Extract actor from reinforcement learning agent |
setActor | Set actor of reinforcement learning agent |
getCritic | Extract critic from reinforcement learning agent |
setCritic | Set critic of reinforcement learning agent |
generatePolicyFunction | Generate MATLAB function that evaluates policy of an agent or policy object |
Examples
Version History
Introduced in R2019a
See Also
Apps
Functions
getAction
|getActor
|getCritic
|getModel
|generatePolicyFunction
|generatePolicyBlock
|getActionInfo
|getObservationInfo
Objects
rlDQNAgentOptions
|rlAgentInitializationOptions
|rlVectorQValueFunction
|rlQValueFunction
|rlQAgent
|rlSARSAAgent