How to load pre trained agent model and simulation by using it?

6 views (last 30 days)
I wanna do simulation by using pre trainned model(agnet).
How should I do ? And Is there a way to check if I can use the trained model (display of training manager, etc.)?
Is it possible to extract observation data from the model?
agentOptions = rlSACAgentOptions;
agentOptions.SampleTime = Ts;
agentOptions.DiscountFactor = 0.5;
agentOptions.TargetSmoothFactor = 1e-3;
agentOptions.ExperienceBufferLength = 1e6;
agentOptions.MiniBatchSize = 1024;
agentOptions.EntropyWeightOptions.TargetEntropy = -1;
agent = rlSACAgent(actor,[critic1 critic2],agentOptions); % What should i do here
maxepisodes = 15000;
maxsteps = 1e6;
trainingOptions = rlTrainingOptions(...
'MaxEpisodes',maxepisodes,...
'MaxStepsPerEpisode',maxsteps,...
'StopOnError','on',...
'Verbose',true,...
'Plots','training-progress',...
'StopTrainingCriteria','AverageReward',...
'StopTrainingValue',Inf,...
'ScoreAveragingWindowLength',10);
%% is this correct way?
load("K35_cal2_joint1_60.mat","agent")
agent = agent;
trainingStats = train(agent,env,trainingOptions);

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by