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

modify PenalizedMCObjective to support non-batch eval #2073

Closed
wants to merge 1 commit into from

Conversation

qingfeng10
Copy link
Contributor

Summary:
To match penalty term with MC objective, we current unsqueeze the first dim which corresponds to the dimension of MC samples. However, when a qxd-dim X tensor is evaluated e.g. computing feasibility, it causes shape mismatch. As one would expect q-dim tensor returned, it will return 1xq-dim tensor instead.

To fix, we check the dims of obj; if it is non-mc samples, we will sequeeze the first dim back.

Differential Revision: D49305807

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

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

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Merging #2073 (c56488a) into main (d81a674) will not change coverage.
The diff coverage is 100.00%.

❗ Current head c56488a differs from pull request most recent head 992b5b2. Consider uploading reports for the commit 992b5b2 to get more accurate results

@@            Coverage Diff            @@
##              main     #2073   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          179       179           
  Lines        15858     15861    +3     
=========================================
+ Hits         15858     15861    +3     
Files Coverage Δ
botorch/acquisition/penalized.py 100.00% <100.00%> (ø)

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

Summary:

To match penalty term with MC objective, we current unsqueeze the first dim which corresponds to the dimension of MC samples. However, when a `qxd`-dim X tensor is evaluated e.g. computing feasibility, it causes shape mismatch. As one would expect `q`-dim tensor returned, it will return `1xq`-dim tensor instead.

To fix, we check the dims of obj; if it is non-mc samples, we will sequeeze the first dim back.

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

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in e1cb934.

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.

2 participants