Contenido principal

Custom Training

R2026b
Train and simulate reinforcement learning agents

You can implement your learning algorithm within custom agents and then train and simulate them using train and sim. You can also develop custom training loops that execute your own training algorithm and use them to train either built-in agents provided by Reinforcement Learning Toolbox™ or your custom agents.

Functions

expand all

setupSet up reinforcement learning environment or initialize data logger object (Since R2022a)
cleanupClean up reinforcement learning environment or data logger object (Since R2022a)
rlCustomEvaluatorCustom object for evaluating reinforcement learning agents during training (Since R2023b)
FileLoggerLog reinforcement learning training data to MAT files (Since R2022b)
MonitorLoggerLog reinforcement learning training data to monitor window (Since R2022b)
trainingProgressMonitorMonitor and plot training progress for deep learning custom training loops (Since R2022b)
setupSet up reinforcement learning environment or initialize data logger object (Since R2022a)
storeStore data in the internal memory of a (file or monitor) logger object (Since R2022b)
writeTransfer stored data from the internal logger memory to the logging target (Since R2022b)
cleanupClean up reinforcement learning environment or data logger object (Since R2022a)
rlReplayMemoryReplay memory experience buffer (Since R2022a)
rlPrioritizedReplayMemoryReplay memory experience buffer with prioritized sampling (Since R2022b)
rlHindsightReplayMemoryHindsight replay memory experience buffer (Since R2023a)
rlHindsightPrioritizedReplayMemoryHindsight replay memory experience buffer with prioritized sampling (Since R2023a)
appendAppend experiences to replay memory buffer (Since R2022a)
sampleSample experiences from replay memory buffer (Since R2022a)
resizeResize replay memory experience buffer (Since R2022b)
allExperiencesReturn all experiences in replay memory buffer (Since R2022b)
validateExperienceValidate experiences for replay memory (Since R2023a)
generateHindsightExperiencesGenerate hindsight experiences from hindsight experience replay buffer (Since R2023a)
evaluateEvaluate function approximator object given observation (or observation-action) input data (Since R2022a)
updateUpdate the state of on optimizer object and a set of learnable parameters using the gradient value (Since R2022a)
rlOptimizerCreates an optimizer object for actors and critics (Since R2022a)
runEpisodeSimulate reinforcement learning environment against policy or agent (Since R2022a)
rolloutExecutes rollout for a vectorized environment with a given policy (Since R2026b)
syncParametersModify the learnable parameters of one approximator toward the learnable parameters of another approximator (Since R2022a)
getLearnableParametersObtain learnable parameter values from agent, function approximator, or policy object
setLearnableParametersSet learnable parameter values of agent, function approximator, or policy object
policyParametersObtain structure of policy parameters to update policy during simulation or deployment (Since R2025a)
updatePolicyParametersUpdate policy according to structure of policy parameters given as input argument (Since R2025a)
FutureObject that supports deferred outputs for reinforcement learning environment simulations running on workers (Since R2022a)
fetchNextRetrieve next available unread outputs from a reinforcement learning environment simulations running on workers (Since R2022a)
fetchOutputsRetrieve results from all reinforcement learning environment simulations running on workers (Since R2022a)
cancelCancel unfinished reinforcement learning environment simulations on workers (Since R2022a)
waitWait for reinforcement learning environment simulations running on a workers to finish (Since R2022a)
dlfevalEvaluate deep learning model for custom training loops
dlaccelerateAccelerate deep learning function
AcceleratedFunctionAccelerated deep learning function

Blocks

RL Agent blockRL AgentReinforcement learning agent
Policy blockPolicyReinforcement learning policy (Since R2022b)

Topics

Develop Custom Agents

Use Custom Training Loops