필터 지우기
필터 지우기

Agent in Workspace after training as the trained one?

조회 수: 6 (최근 30일)
Francesco Mogetti
Francesco Mogetti 2022년 4월 11일
댓글: taghreed mamdouh 2024년 1월 17일
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.

답변 (1개)

Kartik Saxena
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
taghreed mamdouh 2024년 1월 17일
hi Kartik Could you help me to save my trained agent taghreedmamdouh19@gmail.com

댓글을 달려면 로그인하십시오.

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by