Skip to content

Commit b2d9047

Browse files
committed
Skip bound validation in optimize_acqf if inequality constraints are specified
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 pytorch#1231 but there are some nontrivial issues with this, so this provides a quick fix in the meantime.
1 parent 50b6d61 commit b2d9047

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)