Skip to content

Commit

Permalink
Skip bound validation in optimize_acqf if inequality constraints are …
Browse files Browse the repository at this point in the history
…specified (#1297)

Summary:
In some cases we may allow not using box constraints (e.g. when optimizing Alebo). This removes a check that currently breaks Alebo optimization. A proper solution should actually validate the constraint set, this was started in #1231 but there are some nontrivial issues with this, so this provides a quick fix in the meantime.

Pull Request resolved: #1297

Reviewed By: saitcakmak

Differential Revision: D37773082

Pulled By: Balandat

fbshipit-source-id: cc64868a6c0af61aa3c846d2ed51da02cc5f6a20
  • Loading branch information
Balandat authored and facebook-github-bot committed Jul 12, 2022
1 parent e7ec084 commit 2e446b4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions botorch/optim/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,14 @@ def optimize_acqf(
>>> qEI, bounds, 3, 15, 256, sequential=True
>>> )
"""
if not (bounds.ndim == 2 and bounds.shape[0] == 2):
raise ValueError(
f"bounds should be a `2 x d` tensor, current shape: {list(bounds.shape)}."
)
if inequality_constraints is None:
if not (bounds.ndim == 2 and bounds.shape[0] == 2):
raise ValueError(
"bounds should be a `2 x d` tensor, current shape: "
f"{list(bounds.shape)}."
)
# TODO: Validate constraints if provided:
# https://github.com/pytorch/botorch/pull/1231

if sequential and q > 1:
if not return_best_only:
Expand Down

0 comments on commit 2e446b4

Please sign in to comment.