Training reinforcement learning agent in Matlab is slow after setting use Parallel to true.
11 次查看(过去 30 天)
显示 更早的评论
I am trying to train SAC agent which has 19 observation and 4 action all continuous. The whole agent was created similar to the example provided in matlab website (Train SAC Agent for Ball Balance Control - MATLAB & Simulink (mathworks.com)). When useParallel option is set to false the simulation works but very slowly and the agent starts training the the episode rewards are all displayed. After setting the useparallel to true the system shows that it is training but no results are shown that is the simulation is stuck at episode 1. ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1659096/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1659096/image.png)
Here is training options:
trainOpts = rlTrainingOptions(...
'MaxEpisodes', 10000, ...
'MaxStepsPerEpisode', floor(Tf/Ts), ...
'ScoreAveragingWindowLength',100,...
'Verbose', 1, ...
'Plots', 'training-progress', ...
'StopTrainingCriteria','None',...
'SaveAgentCriteria',"EpisodeFrequency", ...
'SaveAgentValue', 100, ...
'UseParallel',true);
Tried running both with sync as well as async but same result as above that is training stuck at 1st episode. What can be the posiible reason for this and can i use my gpu for training?
1 个评论
Joss Knight
2024-4-14
This is a guess, but if this is running on the CPU probably all that's happened you lose multithreading and gain a bunch of communication overhead. Unless you have a compute cluster, best to stick to serial computation.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Training and Simulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!