Does the sampling time of reinforcement learning agents have to be the same as the sampling time of models in simulink? What is the difference between the two?

7 visualizzazioni (ultimi 30 giorni)
Does the sampling time of reinforcement learning agents have to be the same as the sampling time of models in simulink? What is the difference between the two? Currently if I set the agent sampling time ts to 0.001, it will run very slowly, but if I increase the sampling time in the model, the model will not run and the system will be out of control. Perhaps can I reduce the agent sampling time in order to improve the agent training speed, but also reduce the sampling time in the model in order to ensure that the control system in simulink works? Thank you very much for your answer.

Risposte (1)

Ayush Aniket
Ayush Aniket il 18 Set 2024
The sampling time of the Reinforcement Learning (RL) agent does not necessarily have to be the same as the sampling time of the Simulink model, but they are indeed related.
Agent Sampling Time: This is the interval at which the agent interacts with the environment (i.e., the Simulink model) to collect observations, make decisions, and apply actions. A smaller value means the agent makes decisions more frequently, which can increase computational load and slow down training.
Model Sampling Time: This is the time step used for simulating the dynamics of the system within Simulink. A smaller model sampling time ensures more accurate simulation of the continuous dynamics, but it can also increase computational demand.
You need to balance between the accuracy of control and the speed of training. Refer to the following MATLAB Answer for an example scenario of using different sample time for the RL agent: https://www.mathworks.com/matlabcentral/answers/555799-reinforcement-learning-sample-time?s_tid=answers_rc1-2_p2_MLT

Prodotti


Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by