Skip to content
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

Update VecNormalize normalization #609

Merged
merged 17 commits into from
Dec 18, 2019
Merged

Conversation

shwang
Copy link

@shwang shwang commented Dec 10, 2019

Description

Decouples normalization from mean/stddev tracking functionality.
Exposes reward and observation normalization for use outside of .step() and reset().
Add get_original_rews() function which returns the most recent unnormalized rewards.
reset() now updates statistics for observations in addition to normalizing.

Motivation and Context

closes #602.

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

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

Checklist:

  • I've read the CONTRIBUTION guide (required)
  • I have updated the changelog accordingly (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.
  • I have ensured pytest and pytype both pass.

@araffin araffin requested review from araffin and hill-a December 12, 2019 12:58
@araffin
Copy link
Collaborator

araffin commented Dec 12, 2019

Thanks for the PR, I'll try to do a review before next week ;)

Copy link
Collaborator

@AdamGleave AdamGleave left a comment

Choose a reason for hiding this comment

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

Thanks for this PR, overall looks good. Would benefit from some more docs and slightly more comprehensive tests. After that would be happy to approve.

Copy link
Collaborator

@araffin araffin left a comment

Choose a reason for hiding this comment

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

LGTM, some minor point need to be discussed still

Copy link
Collaborator

@AdamGleave AdamGleave left a comment

Choose a reason for hiding this comment

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

LGTM apart from @araffin's comments

@araffin araffin added this to the v2.10.0 milestone Dec 15, 2019
@shwang
Copy link
Author

shwang commented Dec 16, 2019

Thanks for the reviews!

araffin
araffin previously approved these changes Dec 16, 2019
Copy link
Collaborator

@araffin araffin 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 =)

@araffin araffin requested a review from AdamGleave December 16, 2019 22:58
Copy link
Collaborator

@AdamGleave AdamGleave left a comment

Choose a reason for hiding this comment

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

Looking good, two things I'm unsure on and would like feedback.

@araffin
Copy link
Collaborator

araffin commented Dec 18, 2019

i dont have a strong opinion for your two comments

Copy link
Collaborator

@AdamGleave AdamGleave left a comment

Choose a reason for hiding this comment

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

LGTM

@AdamGleave AdamGleave merged commit 99dcdba into hill-a:master Dec 18, 2019
@shwang shwang deleted the vec_norm_public branch December 19, 2019 22:52
shwang added a commit to HumanCompatibleAI/imitation that referenced this pull request Dec 19, 2019
shwang added a commit to HumanCompatibleAI/imitation that referenced this pull request Dec 20, 2019
* Fix errors due to SB change

hill-a/stable-baselines#609

* normalize_{observation=>obs}

* setup.py: Bump update note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[proposal] Public VecNormalize._normalize_observation
3 participants