I get error when I want to define an environment for DQN, that is related to RL observation.
2 ビュー (過去 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!