Scaling layer usage for action output

Hello, I am using the tanhlayer as the output activation function for the action network while my action space is [0,10]. In this sense, I am referring to this answer by adding scaling layer.
However, I got saturated action value. I looked into the answer, shouldn't it be
scalingLayer('Scale',(actionInfo.UpperLimit-actionInfo.LowerLimit)/2,'Bias',(actionInfo.UpperLimit+actionInfo.LowerLimit)/2)
Thanks for your help.
Here is the code"
numActions = 2;
actInfo = rlNumericSpec([numActions 1],'LowerLimit',0,'UpperLimit', 10);
actorNetwork = [
featureInputLayer(numObservations,'Normalization','none','Name','State')
fullyConnectedLayer(32, 'Name','actorFC1')
reluLayer('Name','relu1')
fullyConnectedLayer(16, 'Name','actorFC2')
reluLayer('Name','relu2')
fullyConnectedLayer(numActions,'Name','Action')
tanhLayer('Name','tanh3')
scalingLayer('Scale',actInfo.UpperLimit-actInfo.LowerLimit,'Bias',(actInfo.UpperLimit-actInfo.LowerLimit)/2)
];
actordlNet = dlnetwork(actorNetwork);
actor = rlContinuousDeterministicActor(actordlNet,obsInfo,actInfo);

5 comentarios

Emmanouil Tzorakoleftherakis
Emmanouil Tzorakoleftherakis el 13 de Jun. de 2023
Editada: Emmanouil Tzorakoleftherakis el 13 de Jun. de 2023
Can you post the code you are using to create the actor? Also, which agent are you using? At which value is the action saturated? Between [0 10] or something else?
Thanks for your reply. The code is attached. I think the scaling layer should be
scalingLayer('Scale',actionInfo.UpperLimit-actionInfo.LowerLimit,'Bias',(actionInfo.UpperLimit-actionInfo.LowerLimit)/2)
I corrected the answer, you are right, the scale factor should be divided by 2
Yihao Wan
Yihao Wan el 20 de Jun. de 2023

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Introduction to Installation and Licensing en Centro de ayuda y File Exchange.

Preguntada:

el 9 de Jun. de 2023

Comentada:

el 20 de Jun. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by