-
Notifications
You must be signed in to change notification settings - Fork 413
Enable LineariseRewards
to work with negative weights
#3064
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/3064
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New Failures, 1 Pending, 5 Unrelated FailuresAs of commit 88ceb99 with merge base 523ba2e ( NEW FAILURES - The following jobs have failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks!
def test_weight_sign_error(self): | ||
with pytest.raises(ValueError, match="Expected all weights to be >0"): | ||
LineariseRewards(in_keys=("reward",), weights=-torch.ones(size=(2,))) | ||
def test_weight_no_sign_error(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: its probably cleaner to remove this test now – it does not really test anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I allowed it as a non regression test but you could have said that of the previous one 😄
Description
Enable
LineariseRewards
to work with negative weights.Motivation and Context
Fixes #3063.
Types of changes
What types of changes does your code introduce? Remove all that do not apply:
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!