Skip to content

Commit 2e446b4

Browse files
Balandatfacebook-github-bot
authored andcommitted
Skip bound validation in optimize_acqf if inequality constraints are 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
1 parent e7ec084 commit 2e446b4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

botorch/optim/optimize.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,14 @@ def optimize_acqf(
125125
>>> qEI, bounds, 3, 15, 256, sequential=True
126126
>>> )
127127
"""
128-
if not (bounds.ndim == 2 and bounds.shape[0] == 2):
129-
raise ValueError(
130-
f"bounds should be a `2 x d` tensor, current shape: {list(bounds.shape)}."
131-
)
128+
if inequality_constraints is None:
129+
if not (bounds.ndim == 2 and bounds.shape[0] == 2):
130+
raise ValueError(
131+
"bounds should be a `2 x d` tensor, current shape: "
132+
f"{list(bounds.shape)}."
133+
)
134+
# TODO: Validate constraints if provided:
135+
# https://github.com/pytorch/botorch/pull/1231
132136

133137
if sequential and q > 1:
134138
if not return_best_only:

0 commit comments

Comments
 (0)