How to give initial observations for RL if multiple ObservationInfo are used?

조회 수: 10 (최근 30일)
Wing Yin Ng
Wing Yin Ng 2020년 12월 12일
댓글: Valentyna Afanasenko 2021년 10월 18일
Hello everyone, I want to use the RL toolbox in my work. In my custom environment, it has several observations that are in rlNumericSpec, and others are in rlFiniteSetSpec.
I understand that in order to create an ObservationInfo, I can use:
Observation(1) = rlNumericSpec([4 1]);
Observation(2) = rlFiniteSetSpec([1 2 3]);
...
However, in my custom reset (as well as step) function, how should I return the observation, so that the system can recognized it?
  댓글 수: 1
Valentyna Afanasenko
Valentyna Afanasenko 2021년 10월 18일
Hi!
obsInfo(1) = rlNumericSpec([m n]); %
obsInfo(2) = rlNumericSpec([l k]);
In ResetFunction:
e.g. initialize by 0
LoggedSignal.State{1} = zeros(m,n);
LoggedSignal.State{2} = zeros(l,k);
InitialObservation = LoggedSignal.State;
In StepFunction:
LoggedSignal.State{1}(1:m,1:n)= stepObserv1;
LoggedSignal.State{2}(1:l,1:k)= stepObserv2;
NextObs = LoggedSignals.State;

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

답변 (1개)

Madhav Thakker
Madhav Thakker 2021년 2월 9일
Hi Wing Yin Ng,
I understand you want to write custom reset & step function. This MATLAB example talks about how to do the same. Note that you'll have to keep these functions in your current working folder or on the MATLAB path as mentioned here.
Hope this 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