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

Change how ModelListGP.posterior evaluates sub-models #1854

Closed
wants to merge 2 commits into from

Conversation

saitcakmak
Copy link
Contributor

Summary:
Prior to this change, ModelListGP.posterior would call it's submodels directly and work with the returned MVNs, skipping any processing in the individual posterior methods. This was particularly consequential for the MultiTaskGP (and subclasses) where skipping the posterior meant changing the expected shape of the X required by the posterior.

With this change, ModelListGP.posterior evaluates the posterior methods for each of its submodels, and combines the MVNs into a single MVN where applicable. For MultiTaskGP, this makes it so that the posterior can be evaluated using the same inputs regardless of whether the mdoel is wrapped in a ModelListGP or not.

Differential Revision: D46364187

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

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

saitcakmak added a commit to saitcakmak/botorch that referenced this pull request Jun 1, 2023
…ytorch#1854)

Summary:
Pull Request resolved: pytorch#1854

Prior to this change, `ModelListGP.posterior` would call it's submodels directly and work with the returned MVNs, skipping any processing in the individual `posterior` methods. This was particularly consequential for the `MultiTaskGP` (and subclasses) where skipping the `posterior` meant changing the expected shape of the `X` required by the `posterior`.

With this change, `ModelListGP.posterior` evaluates the `posterior` methods for each of its submodels, and combines the MVNs into a single MVN where applicable. For `MultiTaskGP`, this makes it so that the `posterior` can be evaluated using the same inputs regardless of whether the mdoel is wrapped in a `ModelListGP` or not.

Differential Revision: D46364187

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

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

saitcakmak added a commit to saitcakmak/botorch that referenced this pull request Jun 3, 2023
…ytorch#1854)

Summary:
Pull Request resolved: pytorch#1854

Prior to this change, `ModelListGP.posterior` would call it's submodels directly and work with the returned MVNs, skipping any processing in the individual `posterior` methods. This was particularly consequential for the `MultiTaskGP` (and subclasses) where skipping the `posterior` meant changing the expected shape of the `X` required by the `posterior`.

With this change, `ModelListGP.posterior` evaluates the `posterior` methods for each of its submodels, and combines the MVNs into a single MVN where applicable. For `MultiTaskGP`, this makes it so that the `posterior` can be evaluated using the same inputs regardless of whether the mdoel is wrapped in a `ModelListGP` or not.

Differential Revision: D46364187

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

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

saitcakmak added a commit to saitcakmak/botorch that referenced this pull request Jun 5, 2023
…ytorch#1854)

Summary:
Pull Request resolved: pytorch#1854

Prior to this change, `ModelListGP.posterior` would call it's submodels directly and work with the returned MVNs, skipping any processing in the individual `posterior` methods. This was particularly consequential for the `MultiTaskGP` (and subclasses) where skipping the `posterior` meant changing the expected shape of the `X` required by the `posterior`.

With this change, `ModelListGP.posterior` evaluates the `posterior` methods for each of its submodels, and combines the MVNs into a single MVN where applicable. For `MultiTaskGP`, this makes it so that the `posterior` can be evaluated using the same inputs regardless of whether the mdoel is wrapped in a `ModelListGP` or not.

Differential Revision: D46364187

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

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

@codecov
Copy link

codecov bot commented Jun 5, 2023

Codecov Report

Merging #1854 (2c5b9ae) into main (79a1162) will not change coverage.
The diff coverage is 100.00%.

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

@@            Coverage Diff            @@
##              main     #1854   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          171       171           
  Lines        15055     15051    -4     
=========================================
- Hits         15055     15051    -4     
Impacted Files Coverage Δ
botorch/acquisition/joint_entropy_search.py 100.00% <ø> (ø)
botorch/models/gpytorch.py 100.00% <100.00%> (ø)
botorch/models/model.py 100.00% <100.00%> (ø)
botorch/models/multitask.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

saitcakmak added a commit to saitcakmak/botorch that referenced this pull request Jun 6, 2023
Summary: Prior to this change, `MultiTaskGP` could be evaluated using inputs of shape `batch x d` when using the model directly, and using inputs of shape `batch x d + 1` when the model was wrapped in a `ModelListGP`. This diff (combined with pytorch#1854) legitimizes both input shapes regardless of what API is used to evaluate the model. This will unify the APIs and increase the flexibility in how the model is used.

Differential Revision: D46496775

fbshipit-source-id: 3a11aa5a1a6b79456a57491dac561a3a1860c14b
saitcakmak added a commit to saitcakmak/botorch that referenced this pull request Jun 6, 2023
…h#1868)

Summary:
Pull Request resolved: pytorch#1868

Prior to this change, `MultiTaskGP` could be evaluated using inputs of shape `batch x d` when using the model directly, and using inputs of shape `batch x d + 1` when the model was wrapped in a `ModelListGP`. This diff (combined with pytorch#1854) legitimizes both input shapes regardless of what API is used to evaluate the model. This will unify the APIs and increase the flexibility in how the model is used.

Reviewed By: Balandat

Differential Revision: D46496775

fbshipit-source-id: f44f5e529d9105d203923013101c37a8c1697e52
saitcakmak and others added 2 commits June 6, 2023 17:03
…h#1868)

Summary:
Pull Request resolved: pytorch#1868

Prior to this change, `MultiTaskGP` could be evaluated using inputs of shape `batch x d` when using the model directly, and using inputs of shape `batch x d + 1` when the model was wrapped in a `ModelListGP`. This diff (combined with pytorch#1854) legitimizes both input shapes regardless of what API is used to evaluate the model. This will unify the APIs and increase the flexibility in how the model is used.

Differential Revision: https://internalfb.com/D46496775

fbshipit-source-id: e79dee0cc0ba0cd03fb97382cc1eb9ef4e5a8371
Summary:
Pull Request resolved: pytorch#1854

Prior to this change, `ModelListGP.posterior` would call it's submodels directly and work with the returned MVNs, skipping any processing in the individual `posterior` methods. This was particularly consequential for the `MultiTaskGP` (and subclasses) where skipping the `posterior` meant changing the expected shape of the `X` required by the `posterior`.

With this change, `ModelListGP.posterior` evaluates the `posterior` methods for each of its submodels, and combines the MVNs into a single MVN where applicable. For `MultiTaskGP`, this makes it so that the `posterior` can be evaluated using the same inputs regardless of whether the model is wrapped in a `ModelListGP` or not.

Differential Revision: D46364187

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

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

@saitcakmak saitcakmak changed the title BC-breaking: Change how ModelListGP.posterior evaluates sub-models Change how ModelListGP.posterior evaluates sub-models Jun 7, 2023
facebook-github-bot pushed a commit that referenced this pull request Jun 7, 2023
Summary:
Pull Request resolved: #1868

Prior to this change, `MultiTaskGP` could be evaluated using inputs of shape `batch x d` when using the model directly, and using inputs of shape `batch x d + 1` when the model was wrapped in a `ModelListGP`. This diff (combined with #1854) legitimizes both input shapes regardless of what API is used to evaluate the model. This will unify the APIs and increase the flexibility in how the model is used.

Reviewed By: Balandat

Differential Revision: D46496775

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

This pull request has been merged in ffff366.

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.

Outcome transforms not properly handled when using BatchedMultiOutputGPyTorchModel in ModelListGP
2 participants