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

Support model init kwargs in batch_cross_validation; code quality improvements #2269

Closed
wants to merge 2 commits into from

Conversation

esantorella
Copy link
Member

Summary:
Improvements to batch_cross_validation:

  • Support passing arbitrary keyword arguments onto the model input constructor, such as input and outcome transforms. This makes constructing the batch shape of the transforms awkward. A more natural solution might be to support only input and outcome transforms, not arbitrary keyword arguments, and to have the user pass class names and let BoTorch handle transform instantiation. However, this might not work for arbitrary transforms.
  • Stop passing train_Yvar=None when it is not needed, addressing [Bug] batch_cross_validation should not always pass train_Yvar to the model  #1669
  • Stop using filter_kwargs, which was probably only there to deal with train_Yvar. Now incorrect keyword arguments will raise an exception.
  • Updated tutorial

Differential Revision: D55572964

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

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

…hecks (pytorch#2268)

Summary:

- Deduplicated logic between the cases with and without noise observations
- Broke up into subtests
- Added checks for Yvar produced by cross-validation
- Added checks for device and dtype of results

Differential Revision: D55572962
…mprovements (pytorch#2269)

Summary:

Improvements to `batch_cross_validation`:
* Support passing arbitrary keyword arguments onto the model input constructor, such as input and outcome transforms. This makes constructing the batch shape of the transforms awkward. A more natural solution might be to support only input and outcome transforms, not arbitrary keyword arguments, and to have the user pass class names and let BoTorch handle transform instantiation. However, this might not work for arbitrary transforms.
* Stop passing train_Yvar=None when it is not needed, addressing pytorch#1669
* Stop using `filter_kwargs`, which was probably only there to deal with `train_Yvar`. Now incorrect keyword arguments will raise an exception.
* Updated tutorial

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

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

Copy link

codecov bot commented Mar 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.97%. Comparing base (9a2f544) to head (ac41829).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2269   +/-   ##
=======================================
  Coverage   99.97%   99.97%           
=======================================
  Files         197      197           
  Lines       17148    17149    +1     
=======================================
+ Hits        17144    17145    +1     
  Misses          4        4           

☔ 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 dc55a21.

facebook-github-bot pushed a commit that referenced this pull request Apr 4, 2024
Summary:
## Motivation

This tutorial somehow got mis-formatted in #2269. This fixes it.

### Have you read the [Contributing Guidelines on pull requests](https://github.com/pytorch/botorch/blob/main/CONTRIBUTING.md#pull-requests)?

Yes

Pull Request resolved: #2279

Test Plan:
- Tutorial should look okay
- CI should be able to execute it
-
## Related PRs

#2269

Reviewed By: Balandat

Differential Revision: D55696979

Pulled By: esantorella

fbshipit-source-id: 0f502cab99077b6e10cb7296322ea4a275034331
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.

None yet

2 participants