Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Feature Request] Add batch_shape property to GP models #2301

Open
Balandat opened this issue Mar 13, 2023 · 2 comments
Open

[Feature Request] Add batch_shape property to GP models #2301

Balandat opened this issue Mar 13, 2023 · 2 comments

Comments

@Balandat
Copy link
Collaborator

Balandat commented Mar 13, 2023

🚀 Feature Request

Expose a batch_shape property on models. For Exact GPs or models that have all the training inputs, this can just return the batch shape of the input tensors. For other models this can be overwritten as needed

Motivation

See pytorch/botorch#1680 (comment) - for some fantasizing functionality we'd like to know what the batch shape of the model is to appropriately fantasize based on model outputs.

There are a lot of other use cases for such property, we currently have this defined on the botorch Model class and are using it in a number of places (check the botorch repo).

Pitch

Describe the solution you'd like
Upstream the functionality from botorch.

Describe alternatives you've considered
Not doing this. The downside is that it makes things rather cumbersome and requires some workarounds.

Are you willing to open a pull request? (We LOVE contributions!!!)
Sure

@Balandat
Copy link
Collaborator Author

@gpleiss any thoughts on this?

@gpleiss
Copy link
Member

gpleiss commented Mar 16, 2023

Yeah this is a great idea!

Balandat added a commit that referenced this issue Mar 19, 2023
Implements #2301.

TODO:
- support for approximate GP models
- unit tests
- verify compatibility with the botorch setup of other models
Balandat added a commit that referenced this issue May 21, 2023
Implements #2301.

TODO: Verify compatibility with the botorch setup of other models
Balandat added a commit that referenced this issue Jun 4, 2023
Implements #2301.

TODO: Verify compatibility with the botorch setup of other models
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants