Hi,
I'm trying to continue work training a previously trained RL DDPG Agent using a Simulink model in the 2021a release of MATLAB. When I've tried loading the agent with the following code below, it appears to create a entirely new agent and ignores the behavior I saw in the previous training. Some background info on the agent:
- The agent was trained for 200 episodes and was saved to a '.mat' file
- The options for the training I'm trying to do with the agent are the same for this pretrained agent I'm trying to load.
- The RL network for the actor and the critic is the same.
- I'm saving the Experience Buffer with the Agent in this '.mat file'
- It was trained in 2021a
Is there a way to effectively load the pretrained agent network into the RL DDPG network I use in my MATLAB Simulink Training in MATLAB 2021a or is there a future release of MATLAB that does what I need?
Thank you for your help
Code:
Pretrained_agent_flag = true;
if (Pretrained_agent_flag == true)
pretrainedagent = load('MyAgent.mat'); %Load Previous Agent .mat file
else
agent = rlDDPGAgent(actor,critic,agentOptions); %DDPG Agent
end
trainingResults = train(agent,env,trainingOptions);