rlSARSAAgent
R2026bSARSA reinforcement learning agent
Description
The SARSA algorithm is an on-policy reinforcement learning method for environments with a discrete action space. A SARSA agent trains a Q-value function critic to estimate the value of the current epsilon-greedy policy (it does not try to directly learn an optimal policy). SARSA agents do not support recurrent neural networks.
For more information on SARSA agents, see SARSA Agent.
For more information on the different types of reinforcement learning agents, see Reinforcement Learning Agents.
Creation
Syntax
Description
Create Default Agent from Observation and Action Specifications
creates a SARSA agent for an environment with the given observation and action
specifications, using default initialization options. The critic in the agent uses a
table (if the observation has only one, discrete, channel) or deep neural network
(otherwise).agent = rlSARSAAgent(observationInfo,actionInfo)
creates a SARSA agent for an environment with the given observation and action
specifications. When the agent uses a default network, each hidden fully connected layer
has the number of units specified in the agent = rlSARSAAgent(observationInfo,actionInfo,initOpts)initOpts object. When the
agent uses a table, initOpts is ignored. SARSA agents do not
support recurrent networks. For more information on the initialization options, see
rlAgentInitializationOptions.
Create Agent from Critic
creates a SARSA agent with the specified critic network and sets the agent = rlSARSAAgent(critic,agentOptions)AgentOptions
property.
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 |
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
Functions
getAction|getActor|getCritic|getModel|generatePolicyFunction|generatePolicyBlock|getActionInfo|getObservationInfo
Objects
rlSARSAAgentOptions|rlVectorQValueFunction|rlQValueFunction|rlQAgent|rlLSPIAgent|rlDQNAgent
