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 deploying agents, see Deploy Trained Reinforcement Learning Policies.
Functions
generatePolicyFunction | Generate MATLAB function that evaluates policy of an agent or policy object |
generatePolicyBlock | Generate Simulink block that evaluates policy of an agent or policy object (Since R2022b) |
policyParameters | Obtain structure of policy parameters to update policy during simulation or deployment (Since R2025a) |
updatePolicyParameters | Update policy according to structure of policy parameters given as input argument (Since R2025a) |
Blocks
Policy | Reinforcement learning policy (Since R2022b) |
Topics
- Deploy Trained Reinforcement Learning Policies
You can generate code for reinforcement learning agents using, for example, GPU Coder or MATLAB Coder.
- Deploy Trained Reinforcement Learning Policy as Microservice Docker Image (MATLAB Compiler SDK)
This example shows how to create a microservice Docker® image from reinforcement learning policy.