Where is the actual storage location of the RL agent's weights.

2 visualizaciones (últimos 30 días)
When I trained RL agent, I have got several Agents files such that:
After I loaded one of them to the workspacec I get this data:
But in saved_agent that is used in the simulation next there is no some weights or information that can be used in SImulink modeling.
--------
My question is: Where is exact location of weights of Networks or how the simulation happens ?
--------
P.S. For example I want implements this trained RL NEtwork on real robot, how I make this without weights ?

Respuestas (1)

Emmanouil Tzorakoleftherakis
Emmanouil Tzorakoleftherakis el 5 de Jul. de 2023
Hello,
You can implement the trained policy with automatic code generation, e.g. with MATLAB Coder, Simulink Coder and so on. You don't have to know the weights for that, the code is generated automatically. The following two links provide additional info:
That said, if you still want to take a look at the trained weights, you need to extract the neural network from the agent. You can do this as shown here:
Hope this helps
  2 comentarios
Dmitriy Ogureckiy
Dmitriy Ogureckiy el 17 de Jul. de 2023
Thank you, but my question was how this functions getcritic and getactor get the weight from the agnet, if it don't contain they ?
Emmanouil Tzorakoleftherakis
Emmanouil Tzorakoleftherakis el 17 de Jul. de 2023
Editada: Emmanouil Tzorakoleftherakis el 17 de Jul. de 2023
The agent "includes" the neural networks, which "include" the weights. Just because you can see the weights from the neural network object does not mean you can view them from the agent object. It depends how the code of the classes is structured. The examples I shared show how you can get the weights from the agent.

Iniciar sesión para comentar.

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by