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

Pass botorch_model_class to Surrogate._set_formatted_inputs #2653

Closed
wants to merge 1 commit into from

Conversation

esantorella
Copy link
Contributor

Summary:
Context:

Surrogate._set_formatted_inputs is used only in the following context:

  • A model input constructor sets inputs on the basis of a botorch_model_class and a surrogate. It checks which inputs are valid based on the botorch_model_class
  • The input constructor calls _set_formatted_inputs; if the inputs are not valid (as per the above bullet), it raises an exception.
  • However, _set_formatted_inputs uses surrogate.botorch_model_class rather than botorch_model_class, which may not be the same, and can raise a nonsensical error. Hence there was a unit test raising a puzzling exception that SaasFullyBayesianSingleTaskGP does not support outcome_transform (it does), when it should have been saying that SingleTaskGPWithDifferentConstructor, the model in question, doesn't support outcome_transform.

This PR:

  • Passes botorch_model_class to _set_formatted_inputs
  • changes some list annotations to Sequence to fix type errors

Differential Revision: D61212316

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

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

@codecov-commenter
Copy link

codecov-commenter commented Aug 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.28%. Comparing base (0314b02) to head (df186c5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2653   +/-   ##
=======================================
  Coverage   95.28%   95.28%           
=======================================
  Files         493      493           
  Lines       47746    47746           
=======================================
  Hits        45497    45497           
  Misses       2249     2249           

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

@facebook-github-bot
Copy link
Contributor

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 13, 2024
…book#2653)

Summary:
Pull Request resolved: facebook#2653

Context:

`Surrogate._set_formatted_inputs` is used only in the following context:
- A model input constructor sets inputs on the basis of a `botorch_model_class` and a `surrogate`. It checks which inputs are valid based on the `botorch_model_class`
- The input constructor calls `_set_formatted_inputs`; if the inputs are not valid (as per the above bullet), it raises an exception.
- However, `_set_formatted_inputs` uses `surrogate.botorch_model_class` rather than `botorch_model_class`, which may not be the same, and can raise a nonsensical error. Hence there was a unit test raising a puzzling exception that SaasFullyBayesianSingleTaskGP does not support `outcome_transform` (it does), when it should have been saying that `SingleTaskGPWithDifferentConstructor`, the model in question, doesn't support `outcome_transform`.

This PR:

- Passes `botorch_model_class` to `_set_formatted_inputs`
- changes some `list` annotations to `Sequence` to fix type errors

Reviewed By: Balandat

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

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 13, 2024
…book#2653)

Summary:
Pull Request resolved: facebook#2653

Context:

`Surrogate._set_formatted_inputs` is used only in the following context:
- A model input constructor sets inputs on the basis of a `botorch_model_class` and a `surrogate`. It checks which inputs are valid based on the `botorch_model_class`
- The input constructor calls `_set_formatted_inputs`; if the inputs are not valid (as per the above bullet), it raises an exception.
- However, `_set_formatted_inputs` uses `surrogate.botorch_model_class` rather than `botorch_model_class`, which may not be the same, and can raise a nonsensical error. Hence there was a unit test raising a puzzling exception that SaasFullyBayesianSingleTaskGP does not support `outcome_transform` (it does), when it should have been saying that `SingleTaskGPWithDifferentConstructor`, the model in question, doesn't support `outcome_transform`.

This PR:

- Passes `botorch_model_class` to `_set_formatted_inputs`
- changes some `list` annotations to `Sequence` to fix type errors

Reviewed By: Balandat

Differential Revision: D61212316
…book#2653)

Summary:
Pull Request resolved: facebook#2653

Context:

`Surrogate._set_formatted_inputs` is used only in the following context:
- A model input constructor sets inputs on the basis of a `botorch_model_class` and a `surrogate`. It checks which inputs are valid based on the `botorch_model_class`
- The input constructor calls `_set_formatted_inputs`; if the inputs are not valid (as per the above bullet), it raises an exception.
- However, `_set_formatted_inputs` uses `surrogate.botorch_model_class` rather than `botorch_model_class`, which may not be the same, and can raise a nonsensical error. Hence there was a unit test raising a puzzling exception that SaasFullyBayesianSingleTaskGP does not support `outcome_transform` (it does), when it should have been saying that `SingleTaskGPWithDifferentConstructor`, the model in question, doesn't support `outcome_transform`.

This PR:

- Passes `botorch_model_class` to `_set_formatted_inputs`
- changes some `list` annotations to `Sequence` to fix type errors

Reviewed By: Balandat

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

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 310b43d.

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.

3 participants