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

Changed TheseusLayer.forward() to receive optimizer_kwargs as a single dict #45

Merged
merged 4 commits into from
Jan 24, 2022

Conversation

luisenp
Copy link
Contributor

@luisenp luisenp commented Jan 21, 2022

Motivation and Context

Closes #42
Closes #28

How Has This Been Tested

All tests passes and also added new test to check that kwargs are passed correctly. Also updated tutorials and examples.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • 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)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 21, 2022
@luisenp luisenp self-assigned this Jan 21, 2022
Copy link
Contributor

@mhmukadam mhmukadam left a comment

Choose a reason for hiding this comment

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

Looks good.

@mhmukadam mhmukadam added the refactor Refactor library components label Jan 22, 2022
@mhmukadam mhmukadam added this to the 0.1.0-b.2 milestone Jan 22, 2022
Copy link
Contributor

@vshobha vshobha left a comment

Choose a reason for hiding this comment

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

Can you add a test to show that a user can no longer pass in aux_vars as a keyword argument to forward? I am not sure I see where that is explicitly prevented with the current restructuring..

@luisenp
Copy link
Contributor Author

luisenp commented Jan 24, 2022

Can you add a test to show that a user can no longer pass in aux_vars as a keyword argument to forward? I am not sure I see where that is explicitly prevented with the current restructuring..

Added. In the current version nothing should be accepted besides input_data and optimization_kwargs, since forward does not have a **kwarg argument. However, I didn't know how to test for this, so I added a few variations of aux_vars just to be safe.

Copy link
Contributor

@vshobha vshobha left a comment

Choose a reason for hiding this comment

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

LGTM!

@luisenp luisenp merged commit 58d3c6e into main Jan 24, 2022
@luisenp luisenp deleted the lep.prevent_aux_vars_forward branch January 24, 2022 21:38
suddhu pushed a commit to suddhu/theseus that referenced this pull request Jan 21, 2023
…e dict (facebookresearch#45)

* [refactor] Changed TheseusLayer so that optimizer_kwargs are passed as a single dict.

* Updated all tutorials to use optimizer_kwargs dict in forward().

* Updated examples to use optimizer_kwargs dict in forward().

* Add additional test to check that TheseusLayer.forward(aux_vars=) is not accepted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. refactor Refactor library components
Projects
None yet
5 participants