Agent in Workspace after training as the trained one?
6 次查看(过去 30 天)
显示 更早的评论
Hi, I was wondering if the Agent in the workspace is the trained one after training finished.
The point is that I have a good training result but I set the "saveAgentCriteria" to a too high value. So after the training is terminated I won't be able to simulate with the trained Agent. If I save the Agent in the workspace, I am saving the trained agent or the untrained one? Are there some other ways to save Agent without setting "saveAgentCriteria"? I am using the Reinforcement Learning Episode Manager, not the Reinforcement Learning Designer Session.
Thanks.
0 个评论
回答(1 个)
Kartik Saxena
2024-1-8
Hi,
In MATLAB, when you are training a reinforcement learning agent using functions like `train`, the variable in the workspace that represents the agent is updated with the training progress. After the training process finishes, the agent variable in the workspace holds the trained agent, even if it hasn't met the `saveAgentCriteria`.
To explicitly save the trained agent at the end of the training or at any point during the training, you can use the `save` function in MATLAB. Here's an example of how you might do this:
[trainedAgent, trainingStats] = train(agent, env, trainingOptions);
% Save the trained agent to a MAT-file
save('trainedAgent.mat', 'trainedAgent');
For more information on training options and saving agents, you can refer to the following MathWorks documentation:
I hope this resolves your issue.
1 个评论
taghreed mamdouh
2024-1-17
hi Kartik Could you help me to save my trained agent taghreedmamdouh19@gmail.com
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!