How to implement reinforcement learning in Dspace using code generation

7 visualizzazioni (ultimi 30 giorni)
I have trained a nonlinear model using Reinforcement learning via MATLAB 2022b and now I want to implement the reinforcement learning block in dSPACE using code generation, while the simulink will pop out the error "Code generation does not support importing handle classes from matlab".What should I do to fix this error? Thank you very much. Any suggestions are appreciated.

Risposta accettata

Milan Bansal
Milan Bansal il 7 Set 2023
Hi,
As per my understanding you are facing an error when implementing Reinforcement Learning (RL) Agent block using code generation.
The Reinforcement Learning Agent block does not support code generation for training. A workaround for this issue is to use Simulink Blocks such as MATLAB function Block or "Predict" block from Deep Learning Toolbox in place of RL Agent Block, which will allow using pre-trained networks including RL Policies in Simulink and supports code generation.
Refer to the MATLAB Answer link below which resolves a similar issue.
However, if the error is due to code generation for MATALB handle class, it is required to have a function that invokes the class.
Refer to the example in the documentation link given below.

Più risposte (0)

Categorie

Scopri di più su Simulink Coder in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by