Azzera filtri
Azzera filtri

Agent in Workspace after training as the trained one?

11 visualizzazioni (ultimi 30 giorni)
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.

Risposte (1)

Kartik Saxena
Kartik Saxena il 8 Gen 2024
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 Commento
taghreed mamdouh
taghreed mamdouh il 17 Gen 2024
hi Kartik Could you help me to save my trained agent

Accedi per commentare.




Community Treasure Hunt

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

Start Hunting!

Translated by