I get error when I want to define an environment for DQN, that is related to RL observation.
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi everyone,
I want to generate a DQN actor, but when I want to create an environment, it gives an error, I will be appreciated if anyone can help me with this problem. I have 11 inputs and 3 actions for outputs.
mdl = "challenge";
%% Observation and actions
obsInfo = rlNumericSpec([11 1],'LowerLimit',-inf*ones(11,1),'UpperLimit',inf*ones(11,1));
actInfo = rlFiniteSetSpec({[0 ; 1], [0; 1],[0 ;1]});
obsInfo.Name = "Observation";
actInfo.Name = "Actions";
%% Environment
agentBlk = [mdl '/rlAgent'];
env = rlSimulinkEnv(mdl,agentBlk,obsInfo,actInfo);
it gives me the following error:
Error using rlSimulinkEnv>localValidateIOSpecs (line 172)
Invalid size or type for observation specification.
Error in rlSimulinkEnv (line 90)
localValidateIOSpecs(numAgents,observationInfo,actionInfo);
댓글 수: 0
답변 (1개)
Ayush Aniket
2023년 10월 22일
Hi Armin,
As per my understanding you are getting the error because of the incorrect definition of "Agent Block Paths". For a single RL Agent block, the input to "agentBlocks" argument needs to be a string or character vector containing the block path. However, by your definition it is a string array specifying multiple agents and hence the discrepancy in the observation information. You can correct it as:
%% Environment
agentBlk = mdl + '/rlAgent';
You can read more about the input arguments of "rlSimulinkEnv" function by referring to the following link:
Hope it helps.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Environments에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!