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

[DON'T MERGE] Normalize GAIL encoder inputs #4670

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

ervteng
Copy link
Contributor

@ervteng ervteng commented Nov 19, 2020

Proposed change(s)

Normalize the GAIL encoder inputs using incoming trajectories; this was done in TF but not in Torch. This helps stabilize training and improves performance on Crawler with GAIL.

Types of change(s)

  • Bug fix
  • New feature
  • Code refactor
  • Breaking change
  • Documentation update
  • Other (please describe)

Checklist

  • Added tests that prove my fix is effective or that my feature works
  • Updated the changelog (if applicable)
  • Updated the documentation (if applicable)
  • Updated the migration guide (if applicable)

Other comments

@ervteng ervteng changed the title [bug-fix] Normalize GAIL encoder inputs [DON'T MERGE] Normalize GAIL encoder inputs Nov 19, 2020
estimate = self._estimator(hidden).squeeze(1)
gradient = torch.autograd.grad(
estimate,
encoder_input,
Copy link
Contributor

Choose a reason for hiding this comment

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

I do think it makes more sense to compute the gradient with respect to the normalized observations rather than the raw ones. Not sure at all how to do this without having to take the normalization out of the NetworkBody.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think without doing this it's actually broken and doesn't train.

We could do the ugly thing of reaching into the NetworkBody and grabbing the normalized obs, or grabbing the normalizer and applying it to the observation.

Base automatically changed from master to main February 25, 2021 19:16
@miguelalonsojr miguelalonsojr self-assigned this Jan 19, 2022
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Ervin Teng seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

4 participants