botorch icon indicating copy to clipboard operation
botorch copied to clipboard

Validate constraints in optimize_acqf

Open Balandat opened this issue 3 years ago • 9 comments

In some cases we may allow not using box constraints (e.g. when optimizing Alebo). Also, in general it would be good to the optimziation raise an error if the constraint set is empty.

Will require some unit tests.

Balandat avatar May 22 '22 05:05 Balandat

Codecov Report

Merging #1231 (b499da9) into main (0afcf35) will decrease coverage by 0.00%. The diff coverage is 100.00%.

@@             Coverage Diff             @@
##              main    #1231      +/-   ##
===========================================
- Coverage   100.00%   99.99%   -0.01%     
===========================================
  Files          122      122              
  Lines        10553    10607      +54     
===========================================
+ Hits         10553    10606      +53     
- Misses           0        1       +1     
Impacted Files Coverage Δ
botorch/optim/optimize.py 100.00% <100.00%> (ø)
botorch/acquisition/fixed_feature.py 98.18% <0.00%> (-1.82%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0afcf35...b499da9. Read the comment docs.

codecov[bot] avatar May 22 '22 05:05 codecov[bot]

Not sure why the MacOS tests are failing, but that's unrelated to this PR.

Balandat avatar May 22 '22 16:05 Balandat

@Balandat has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar May 22 '22 16:05 facebook-github-bot

One question here is whether we're ok with solving an LP on each call of optimize_acqf as this isn't super lightweight. But I guess it's rather minimal compare to full fledged acquisition function optimization. We could also add a validate_constraints option that defaults to True but that we set to False in situations like running sequential greedy optimization where we know constraints don't change between calls.

Balandat avatar May 22 '22 16:05 Balandat

@Balandat has updated the pull request. You must reimport the pull request before landing.

facebook-github-bot avatar May 28 '22 02:05 facebook-github-bot

@Balandat has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar May 28 '22 02:05 facebook-github-bot

Coverage gap is unrelated and fixed in #1234

Balandat avatar May 28 '22 03:05 Balandat

Is there still a need for this? Conceptually the _validate_constraints function still makes sense.

esantorella avatar May 30 '23 21:05 esantorella

Yeah I think we still want to do this, just correctly :) I think we should be able to use a slightly different reformulation of the problem to avoid the non-convexity issue.

Balandat avatar May 30 '23 23:05 Balandat