Set gpu option for rlPPOAgent actor

조회 수: 5 (최근 30일)
John Doe
John Doe 2021년 3월 10일
Hi,
Is there a way to set the gpu option for an rlPPOAgent actor?
agent = rlPPOAgent(obsInfo,actInfo,agentOpts);
critic = getCritic(agent);
critic.Options.LearnRate = 1e-3;
critic.Options.UseDevice = 'gpu';
agent = setCritic(agent,critic);
I was able to set the critic to gpu but need to know how to set it for the actor. agentOpts is rlPPOAgentOptions, which doesn't take UseDevice.
Thanks!

답변 (1개)

Emmanouil Tzorakoleftherakis
Emmanouil Tzorakoleftherakis 2021년 3월 11일
What you have specified is sufficient for the critic. If you do the same for the actor you are all set - there is no additional param for the agent overall (actor and critic are two key components of the agent after all)
  댓글 수: 7
John Doe
John Doe 2021년 3월 25일
I could use some guidance here to run fully on GPU. My env runs pretty slow right now
Emmanouil Tzorakoleftherakis
Emmanouil Tzorakoleftherakis 2021년 3월 25일
I believe I already answered this question - for the actor you need to do the same thing you did for the critic.
actor = getActor(agent);
actor.Options.UseDevice = 'gpu';
agent = setCritic(agent,actor);
If the environment itse;f is simulating slowly GPUs will not help as much. You need to check your model and identify what's slow

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

카테고리

Help CenterFile Exchange에서 Policies and Value Functions에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by