decaying clip factor or entropy loss weight for PPO

7 views (last 30 days)
Is there a way to implement decaying clip factor or entropy loss weight in PPO matlab??
or how can i reduce the exploration after certain episodes in PPO ??

Accepted Answer

Emmanouil Tzorakoleftherakis
These parameters are fixed and cannot be changed after training begins. One workaround would be to train the agent for a certain number of episodes, stop training and adjust any parameters you would like, and then continue training from where you left off.
  3 Comments
Emmanouil Tzorakoleftherakis
Are you getting any errors? It's likely that the change is happening but it's not displayed. Can you try
format long
Sourabh
Sourabh on 29 Jan 2024
yeah my mistake
its working properly and on using "format long" i can see the changes properly.
Thanks :)

Sign in to comment.

More Answers (1)

UDAYA PEDDIRAJU
UDAYA PEDDIRAJU on 15 Jan 2024
Hi Sourabh,
For implementing decaying clip factor or entropy loss weight in PPO using MATLAB. I would suggest you use the “rlPPOAgentOptions” function in MATLAB. This function provides you with the option to set the “ClipFactor” and “EntropyLossWeight” parameters for the PPO agent. The “ClipFactor” parameter is used to specify the clip factor, which is set to 0.2 by default. The “EntropyLossWeight” parameter is used to specify the weight of the entropy loss term in the loss function. You can set these parameters to your desired values using the “rlPPOAgentOptions” function.
%a conceptual example of how you might adjust the `cliprange` value over time:
initial_cliprange = 0.2;
final_cliprange = 0.1;
total_episodes = 1000;
decay_rate = (initial_cliprange - final_cliprange) / total_episodes;
for episode = 1:total_episodes
current_cliprange = max(final_cliprange, initial_cliprange - decay_rate * episode);
% Update your PPO algorithm's cliprange parameter
end
Regarding your second question, you can reduce exploration after certain episodes in PPO by using the “rlTrainingOptions” function in MATLAB. This function provides you with the option to set the “ExplorationFraction” parameter, which is used to specify the fraction of the total training steps that are used for exploration. You can set this parameter to a lower value to reduce exploration after certain episodes.
For more details you can refer: https://www.mathworks.com/help/reinforcement-learning/ref/rl.option.rlppoagentoptions.html and https://www.mathworks.com/help/reinforcement-learning/ug/ppo-agents.html

Community Treasure Hunt

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

Start Hunting!