load multiple trained reinforcement agents into MATLAB workspace

조회 수: 2 (최근 30일)
Alex Grimshaw
Alex Grimshaw 2020년 2월 25일
편집: Anh Tran 2020년 3월 9일
I have trained a DDPQ reinforcement learning agent and saved all agents with a reward over a set critieria.
These have all been saved into the same file directory autonomously with the name "AgentXXXX" with XXXX being the training iteration (note these are not necassarily sequential).
I am looking to assess them all over 10 randomly initiated tests to identify the top 5% for further testing.
The question I have is how to import all the agents to the matlab workspace with unique names as to test them all in one for loop so I do not have to manually load each agent.
there are around 2000 saved agents.

채택된 답변

Anh Tran
Anh Tran 2020년 3월 6일
편집: Anh Tran 2020년 3월 9일
It is not neccessary to load all 2000 agents into MATLAB (consume memory and tricky to assign unique name) to evaluate their performance. Instead, I believe a more reasonable approach would be load an agent, run 10 tests, log results and repeat
% get a list of all mat file in the folder, assuming only agent are saved in the folder as mat file
listing = dir('*.mat');
for ct = 1:numel(listing)
load(listing(ct).name)
% run test on agent
% log result
end
% combine result from each agent
% analyze
  댓글 수: 1
Alex Grimshaw
Alex Grimshaw 2020년 3월 9일
Thanks for the answer.
This is almost exactly what I have ended up implementing and performing iteratively and worked really well.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Reinforcement Learning에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by