Contenu principal

Policy Deployment

Code generation and deployment of trained policies

Once you train a reinforcement learning agent, you can generate code to deploy the optimal policy. For example, using MATLAB® Coder™ and GPU Coder™, you can generate C++ or CUDA® code and deploy neural network policies on embedded platforms.

For an introduction to generating code from a policy, see Generate Code from Trained Reinforcement Learning Policies. For an introduction to training a deployed policy, see Examine Approaches to Fine Tune a Deployed Policy.

Functions

generatePolicyFunctionGenerate MATLAB function that evaluates policy of an agent or policy object
generatePolicyBlockGenerate Simulink block that evaluates policy of an agent or policy object (Since R2022b)
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)

Blocks

PolicyReinforcement learning policy (Since R2022b)

Topics

Featured Examples