-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix to use float64 actions for off policy algorithms #1572
Merged
araffin
merged 17 commits into
DLR-RM:master
from
tobirohrer:bugfix/1145-off-policy-float64-actions
Jul 24, 2023
Merged
Fix to use float64 actions for off policy algorithms #1572
araffin
merged 17 commits into
DLR-RM:master
from
tobirohrer:bugfix/1145-off-policy-float64-actions
Jul 24, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…etween `ReplayBuffer` and `RolloutBuffer`. Fixing issue DLR-RM#1145
araffin
reviewed
Jun 23, 2023
…hem to float32 anyways.
- Added cast to `DictReplayBuffer` as well
tobirohrer
commented
Jun 29, 2023
araffin
reviewed
Jul 4, 2023
araffin
approved these changes
Jul 24, 2023
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 =)
(and sorry for the delay)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Using float64 actions in continuous off-policy algorithms like TD3 and DDPG caused an error.
The core of the issue is how
ReplayBuffer
andRolloutBuffer
are storing actions. TheRolloutBuffer
for On-Policy algorithms always casts the actions to float32. The ReplayBuffer on the other hand doesn´t. This MR fixes this issue for now by casting actions to float32 in theReplayBuffer
as well.Motivation and Context
closes #1145
Types of changes
Checklist
make format
(required)make check-codestyle
andmake lint
(required)make pytest
andmake type
both pass. (required)Disclaimer: The test
test_vec_envs.py::test_render[SubprocVecEnv]
fails on my local machine. But it fails on the master branch too.make doc
(required)