Skip to content

Conversation

@albertbou92
Copy link
Contributor

@albertbou92 albertbou92 commented Nov 29, 2022

Description

The helper function that creates the PPO loss does not allow specifying things like the clipping parameter for the ClipPPOLoss version of the loss, the KL coefficient for KLPENPPOLoss, etc.

This PR suggest minor changes to allow for this customisation.

Types of changes

What types of changes does your code introduce? Remove all that do not apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds core functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)
  • Example (update in the folder of examples)

Checklist

Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!

  • I have read the CONTRIBUTION guide (required)
  • My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • I have updated the documentation accordingly.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 29, 2022
@codecov
Copy link

codecov bot commented Dec 2, 2022

Codecov Report

Merging #718 (535c2bd) into main (bac229a) will decrease coverage by 0.03%.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##             main     #718      +/-   ##
==========================================
- Coverage   88.66%   88.63%   -0.04%     
==========================================
  Files         120      120              
  Lines       20186    20200      +14     
==========================================
+ Hits        17898    17904       +6     
- Misses       2288     2296       +8     
Flag Coverage Δ
habitat-gpu 25.05% <ø> (ø)
linux-cpu 85.57% <60.00%> (-0.02%) ⬇️
linux-gpu 86.52% <60.00%> (-0.02%) ⬇️
linux-jumanji 30.27% <ø> (ø)
linux-outdeps-gpu 72.21% <60.00%> (-0.01%) ⬇️
linux-stable-cpu 85.43% <60.00%> (-0.02%) ⬇️
linux-stable-gpu 86.15% <60.00%> (-0.04%) ⬇️
linux_examples-gpu 43.12% <60.00%> (+0.02%) ⬆️
macos-cpu 85.24% <60.00%> (-0.02%) ⬇️
olddeps-gpu 76.00% <60.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
torchrl/trainers/helpers/losses.py 42.42% <60.00%> (+2.59%) ⬆️
torchrl/envs/vec_env.py 68.56% <0.00%> (-0.51%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@vmoens vmoens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

@vmoens vmoens merged commit 0fb8d88 into pytorch:main Dec 2, 2022
@albertbou92 albertbou92 deleted the ppo_loss_config branch January 18, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants