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

Put input transforms into train mode before converting models #1283

Closed
wants to merge 1 commit into from

Conversation

saitcakmak
Copy link
Contributor

Summary:
Fixes #1273

During model construction, input transforms should be in train mode (so that they only apply if transform_on_train is true).
Having the input transforms in eval mode leads to buggy behavior due to transformed_X getting transformed when it shouldn't.

Differential Revision: D37542474

@facebook-github-bot facebook-github-bot added CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported labels Jun 30, 2022
@facebook-github-bot
Copy link
Contributor

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

@codecov
Copy link

codecov bot commented Jun 30, 2022

Codecov Report

Merging #1283 (b0b7ca6) into main (7ce7c6d) will not change coverage.
The diff coverage is 100.00%.

❗ Current head b0b7ca6 differs from pull request most recent head bac446a. Consider uploading reports for the commit bac446a to get more accurate results

@@            Coverage Diff            @@
##              main     #1283   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          122       122           
  Lines        10595     10601    +6     
=========================================
+ Hits         10595     10601    +6     
Impacted Files Coverage Δ
botorch/models/converter.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ce7c6d...bac446a. Read the comment docs.

…h#1283)

Summary:
Pull Request resolved: pytorch#1283

Fixes pytorch#1273

During model construction, input transforms should be in `train` mode (so that they only apply if `transform_on_train` is true).
Having the input transforms in eval mode leads to buggy behavior due to `transformed_X` getting transformed when it shouldn't.

Differential Revision: D37542474

fbshipit-source-id: f4278294de5d83d967f3d21c312370e562cf372c
@facebook-github-bot
Copy link
Contributor

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

Copy link
Contributor

@Balandat Balandat 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!

saitcakmak added a commit to saitcakmak/botorch that referenced this pull request Oct 17, 2022
…putModel`

Summary:
This fixes a bug where, due to the input transform being in `train` mode while the model is in `eval` mode, the learnable bounds of input transforms, such as Normalize, would be wrongly updated during model training, effectively disabling the transforms.

This is a serious bug that was leading to using the model trained with normalized inputs on a model without any normalization. It has been around for a while, since pytorch#1283 :'(.

Differential Revision: D40453200

fbshipit-source-id: d30e9ba18fa466c01bbf3273165e6e35ac33c219
saitcakmak added a commit to saitcakmak/botorch that referenced this pull request Oct 17, 2022
…putModel` (pytorch#1454)

Summary:
Pull Request resolved: pytorch#1454

This fixes a bug where, due to the input transform being in `train` mode while the model is in `eval` mode, the learnable bounds of input transforms, such as Normalize, would be wrongly updated during model training, effectively disabling the transforms.

This is a serious bug that was leading to using the model trained with normalized inputs on a model without any normalization. It has been around for a while, since pytorch#1283 :'(.

Differential Revision: D40453200

fbshipit-source-id: 0d60ac5f23efe06e200713555dfa109b612d9290
facebook-github-bot pushed a commit that referenced this pull request Oct 18, 2022
…putModel` (#1454)

Summary:
Pull Request resolved: #1454

This fixes a bug where, due to the input transform being in `train` mode while the model is in `eval` mode, the learnable bounds of input transforms, such as Normalize, would be wrongly updated during model training, effectively disabling the transforms.

This is a serious bug that was leading to using the model trained with normalized inputs on a model without any normalization. It has been around for a while, since #1283 :'(.

Reviewed By: Balandat

Differential Revision: D40453200

fbshipit-source-id: 3a431406de07565a6ccab3ab22ddc667a39b8c2c
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Using batched_to_model_list on a model with AppendFeature input transform
3 participants