Borrar filtros
Borrar filtros

Agent in Workspace after training as the trained one?

6 visualizaciones (últimos 30 días)
Francesco Mogetti
Francesco Mogetti el 11 de Abr. de 2022
Comentada: taghreed mamdouh el 17 de En. de 2024
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.

Respuestas (1)

Kartik Saxena
Kartik Saxena el 8 de En. de 2024
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 comentario
taghreed mamdouh
taghreed mamdouh el 17 de En. de 2024
hi Kartik Could you help me to save my trained agent taghreedmamdouh19@gmail.com

Iniciar sesión para comentar.

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