Main Content

MATLAB Environments

Model reinforcement learning environment dynamics using MATLAB®

In a reinforcement learning scenario, the environment models the dynamics with which the agent interacts. The environment:

  1. Receives actions from the agent

  2. Outputs observations resulting from the dynamic behavior of the environment model

  3. Generates a reward measuring how well the action contributes to achieving the task

You can create predefined and custom environments in MATLAB. For more information, see Create MATLAB Reinforcement Learning Environments.

Functions

expand all

rlPredefinedEnvCreate a predefined reinforcement learning environment
rlFunctionEnvSpecify custom reinforcement learning environment dynamics using functions
rlCreateEnvTemplateCreate custom reinforcement learning environment template
rlMDPEnvCreate Markov decision process environment for reinforcement learning
createMDPCreate Markov decision process model
createGridWorldCreate a two-dimensional grid world for reinforcement learning
validateEnvironmentValidate custom reinforcement learning environment
generateRewardFunctionGenerate a reward function from control specifications to train a reinforcement learning agent
exteriorPenaltyExterior penalty value for a point with respect to a bounded region
hyperbolicPenaltyHyperbolic penalty value for a point with respect to a bounded region
barrierPenaltyLogarithmic barrier penalty value for a point with respect to a bounded region
rlNeuralNetworkEnvironmentEnvironment model with deep neural network transition models
rlContinuousDeterministicTransitionFunctionDeterministic transition function approximator object for neural network-based environment
rlContinuousGaussianTransitionFunctionStochastic Gaussian transition function approximator object for neural network-based environment
rlContinuousDeterministicRewardFunctionDeterministic reward function approximator object for neural network-based environment
rlContinuousGaussianRewardFunctionStochastic Gaussian reward function approximator object for neural network-based environment
rlIsDoneFunctionIs-done function approximator object for neural network-based environment
predictPredict next observation, next reward, or episode termination given observation and action input data
evaluateEvaluate function approximator object given observation (or observation-action) input data
accelerateOption to accelerate computation of gradient for approximator object based on neural network
rlFiniteSetSpecCreate discrete action or observation data specifications for reinforcement learning environments
rlNumericSpecCreate continuous action or observation data specifications for reinforcement learning environments
getActionInfoObtain action data specifications from reinforcement learning environment, agent, or experience buffer
getObservationInfoObtain observation data specifications from reinforcement learning environment, agent, or experience buffer
resetReset environment, agent, experience buffer, or policy object
setupSet up reinforcement learning environment or initialize data logger object
cleanupClean up reinforcement learning environment or data logger object

Topics