DLR-RM / stable-baselines3

PyTorch version of Stable Baselines, reliable implementations of reinforcement learning algorithms.
https://stable-baselines3.readthedocs.io
MIT License
9k stars 1.69k forks source link

[Question] How to customize the loss calculation for PPO #2028

Open olmoulin opened 3 hours ago

olmoulin commented 3 hours ago

❓ Question

Hi, For a research purpose, I need to modify the loss calculation for PPO in order to take into account another parameter ... I have modified the PPO.py file as follow : loss = (policy_loss + self.ent_coef entropy_loss + self.vf_coef value_loss + gen_loss), gen_loss being my new parameter ... but this has absolutely no impact on the training ... not sure, but am I making something wrong there ? thanks a lot in adance.

Checklist

araffin commented 2 hours ago

Probably a duplicate of https://github.com/DLR-RM/stable-baselines3/issues/1881

olmoulin commented 2 hours ago

This is what I have applied, and it does run properly my code, but it seems that no matter how much you modify the loss calculation it has no impact ... am I missing something ? Can you please then remove the duplicate tag on it. thanks