Normalize rewards by standard deviation of discounted return in MuJoCo#149
Open
vzhuang wants to merge 1 commit intoastooke:masterfrom
Open
Normalize rewards by standard deviation of discounted return in MuJoCo#149vzhuang wants to merge 1 commit intoastooke:masterfrom
vzhuang wants to merge 1 commit intoastooke:masterfrom
Conversation
Author
Codecov Report
@@ Coverage Diff @@
## master #149 +/- ##
==========================================
- Coverage 22.56% 22.56% -0.01%
==========================================
Files 128 128
Lines 7987 8014 +27
==========================================
+ Hits 1802 1808 +6
- Misses 6185 6206 +21
Continue to review full report at Codecov.
|
Owner
|
OK this is interesting and I think it can be made a lot simpler. As far as I can tell from the PR, the same could be achieved by changing Lines 47 to 49 in 85d4e01 by inserting: if self.normalize_reward:
return_ = discount_return(reward, done, 0., self.discount) # NO boostrapping of value
self.rets_rms.update(return_.view(-1, 1)) # matching the shape you used, not sure if the extra dim is needed?
std_dev = torch.sqrt(self.rets_rms.var)
reward = torch.div(reward, std_dev)
# proceed with computing discounted returns or GAE returns using the scaled rewardI think that accomplishes the same math? And doesn't need to change any files in the sampler :) |
Owner
|
Any more comment? Anyone else used this? |
This file contains hidden or 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
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.
Averaged results over 10 runs for PPO on Walker2d-v3: