How to simulate saved agents?

trainOpts.SaveAgentCriteria = "EpisodeCount";
trainOpts.SaveAgentValue = 1;
trainOpts.SaveAgentDirectory = pwd + "\Agents";
trainingStats = train(agent,env,trainOpts);
simOpts = rlSimulationOptions(...
'MaxSteps',1000,...
'NumSimulations',3);
load Agents/Agent1.mat
xpr = sim(env,Agent1,simOpts)
I have saved agents in "Agents" folder as shown. How do I simulate these agents? Last two lines in the code above are incorrect. What is the correct way?

답변 (1개)

Emmanouil Tzorakoleftherakis
Emmanouil Tzorakoleftherakis 2021년 2월 23일

0 개 추천

Hello,
Righ-click on the 'Agents' folder from within MATLAB and add it to path (or use addpath). Then
load Agent1.mat
xpr = sim(env,Agent1,simOpts)

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

질문:

2021년 2월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by