Comprehension problem: Unable to reset RL Agent (DDPG)

I have trained an RL agent and can confirm that its behavior is close to a possible solution. Now I want to reset the knowledge of the agent (empty experience buffer, reset weights of the neural network of critic and actor) and therefore used
agent = reset(agent).
I can confirm the empty experience buffer, but the behavior is still the same. What have I missed here and how can I reset the policies?
And no, I did not save the progress of the agent (consciously).
Many thanks in advance!

Answers (1)

Hi,
I understand that you would like to reset the agent by using the “reset” function. However, it should be noted that using the reset function on agent will not reset the weights.
To reset the weights, you must explicitly reinitialize the actor and critic networks of the agent.
You can do as below:
agent = reset(agent);
critic = rlQValueFunction(criticNet,obsInfo,actInfo);
actor = rlContinuousDeterministicActor(actorNet,obsInfo,actInfo);
agent.critic = critic;
agent.actor = actor;
You can modify the initialization of critic and actor as required.
Hope this helps!

Asked:

on 13 Jun 2022

Answered:

on 1 Sep 2023

Community Treasure Hunt

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

Start Hunting!