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

Apply input transforms when computing MLL in model closures #2527

Closed
wants to merge 1 commit into from

Conversation

saitcakmak
Copy link
Contributor

Summary:
During model training, the input transforms are applied in model.forward. While evaluating the model closures, we pass in the train inputs to the mll, which passed them down to the likelihood. If we don't transform the inputs before passing them into mll, we end up evaluating model.forward and likelihood using different inputs.

This is not an issue during the posterior evaluation, since the transforms are applied in model.posterior before being passed to model.__call__ and likelihood.

This diff updates the model closures to transform the inputs before passing them into mll.

Fixes #2515

Differential Revision: D62497392

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Sep 11, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D62497392

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D62497392

saitcakmak added a commit to saitcakmak/botorch that referenced this pull request Sep 11, 2024
…2527)

Summary:
Pull Request resolved: pytorch#2527

During model training, the input transforms are applied in `model.forward`. While evaluating the model closures, we pass in the train inputs to the `mll`, which passed them down to the `likelihood`. If we don't transform the inputs before passing them into `mll`, we end up evaluating `model.forward` and `likelihood` using different inputs.

This is not an issue during the `posterior` evaluation, since the transforms are applied in `model.posterior` before being passed to `model.__call__` and `likelihood`.

This diff updates the model closures to transform the inputs before passing them into `mll`.

Fixes pytorch#2515

Differential Revision: D62497392
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D62497392

saitcakmak added a commit to saitcakmak/botorch that referenced this pull request Sep 11, 2024
…2527)

Summary:
Pull Request resolved: pytorch#2527

During model training, the input transforms are applied in `model.forward`. While evaluating the model closures, we pass in the train inputs to the `mll`, which passed them down to the `likelihood`. If we don't transform the inputs before passing them into `mll`, we end up evaluating `model.forward` and `likelihood` using different inputs.

This is not an issue during the `posterior` evaluation, since the transforms are applied in `model.posterior` before being passed to `model.__call__` and `likelihood`.

This diff updates the model closures to transform the inputs before passing them into `mll`.

Fixes pytorch#2515

Differential Revision: D62497392
…2527)

Summary:
Pull Request resolved: pytorch#2527

During model training, the input transforms are applied in `model.forward`. While evaluating the model closures, we pass in the train inputs to the `mll`, which passed them down to the `likelihood`. If we don't transform the inputs before passing them into `mll`, we end up evaluating `model.forward` and `likelihood` using different inputs.

This is not an issue during the `posterior` evaluation, since the transforms are applied in `model.posterior` before being passed to `model.__call__` and `likelihood`.

This diff updates the model closures to transform the inputs before passing them into `mll`.

Fixes pytorch#2515

Reviewed By: SebastianAment

Differential Revision: D62497392
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D62497392

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.98%. Comparing base (db96db3) to head (5d9c738).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2527   +/-   ##
=======================================
  Coverage   99.98%   99.98%           
=======================================
  Files         193      193           
  Lines       16996    17000    +4     
=======================================
+ Hits        16994    16998    +4     
  Misses          2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in c895a8d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Possibly inconsistent likelihood calls with input transforms
2 participants