Skip to content

Conversation

@esantorella
Copy link
Contributor

Summary:
Context: This was erroring because it was trying to index into a 0d tensor. This issue wasn't caught because the unit test mocked out underlying BoTorch functionality. optimize_acqf returns a 0d tensor when q=1 and return_best is True (the default).

This PR:

  • Adds a docstring
  • Replaces acqf_values[0] with acqf_values.

Differential Revision: D61209456

@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: D61209456

@facebook-github-bot
Copy link
Contributor

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 13, 2024
Summary:
Pull Request resolved: facebook#2652

Context: This was erroring because it was trying to index into a 0d tensor. This issue wasn't caught because the unit test mocked out underlying BoTorch functionality. `optimize_acqf` returns a 0d tensor when q=1 and `return_best` is True (the default).

This PR:
- Adds a docstring
- Replaces `acqf_values[0]` with `acqf_values`.

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

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 13, 2024
Summary:
Pull Request resolved: facebook#2652

Context: This was erroring because it was trying to index into a 0d tensor. This issue wasn't caught because the unit test mocked out underlying BoTorch functionality. `optimize_acqf` returns a 0d tensor when q=1 and `return_best` is True (the default).

This PR:
- Adds a docstring
- Replaces `acqf_values[0]` with `acqf_values`.

Differential Revision: D61209456
@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.26%. Comparing base (0314b02) to head (81662f2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2652      +/-   ##
==========================================
- Coverage   95.28%   95.26%   -0.03%     
==========================================
  Files         493      493              
  Lines       47746    47753       +7     
==========================================
- Hits        45497    45493       -4     
- Misses       2249     2260      +11     

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

@esantorella esantorella linked an issue Aug 13, 2024 that may be closed by this pull request
1 task
esantorella and others added 2 commits August 13, 2024 13:58
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
Summary:
Pull Request resolved: facebook#2652

Context: This was erroring because it was trying to index into a 0d tensor. This issue wasn't caught because the unit test mocked out underlying BoTorch functionality. `optimize_acqf` returns a 0d tensor when q=1 and `return_best` is True (the default).

This PR:
- Adds a docstring
- Replaces `acqf_values[0]` with `acqf_values`.

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

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 13, 2024
Summary:
Pull Request resolved: facebook#2652

Context: This was erroring because it was trying to index into a 0d tensor. This issue wasn't caught because the unit test mocked out underlying BoTorch functionality. `optimize_acqf` returns a 0d tensor when q=1 and `return_best` is True (the default).

This PR:
- Adds a docstring
- Replaces `acqf_values[0]` with `acqf_values`.

Differential Revision: D61209456
esantorella added a commit to esantorella/Ax that referenced this pull request Aug 14, 2024
Summary:
Pull Request resolved: facebook#2652

Context: This was erroring because it was trying to index into a 0d tensor. This issue wasn't caught because the unit test mocked out underlying BoTorch functionality. `optimize_acqf` returns a 0d tensor when q=1 and `return_best` is True (the default).

This PR:
- Adds a docstring
- Replaces `acqf_values[0]` with `acqf_values`.

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

This pull request has been merged in d8078c5.

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.

[GENERAL SUPPORT]: Getting best predicted point of a botorch model

3 participants