필터 지우기
필터 지우기

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);

답변 (1개)

Ayush Aniket
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.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by