Skip to content

Commit

Permalink
remove validation
Browse files Browse the repository at this point in the history
  • Loading branch information
saitcakmak committed Jan 16, 2025
1 parent aef25d7 commit b6e7ee0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
2 changes: 0 additions & 2 deletions botorch/optim/optimize_mixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,6 @@ def continuous_step(
"""
bounds = opt_inputs.bounds
options = opt_inputs.options or {}
if (current_x < bounds[0]).any() or (current_x > bounds[1]).any():
raise ValueError("continuous_step requires current_x to be within bounds.")
if len(discrete_dims) == len(current_x): # nothing continuous to optimize
with torch.no_grad():
return current_x, opt_inputs.acq_function(current_x.unsqueeze(0))
Expand Down
17 changes: 0 additions & 17 deletions test/optim/test_optimize_mixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,23 +420,6 @@ def test_continuous_step(self):
self.assertTrue(X is X_out) # testing pointer equality for due to short cut
self.assertAllClose(ei_val, ei(X[None]))

# Input outside of bounds raises error.
invalid_X = X.clone()
invalid_X[2] = 2
with self.assertRaisesRegex(
ValueError,
"continuous_step requires current_x to be",
):
X_new, ei_val = continuous_step(
opt_inputs=_make_opt_inputs(
acq_function=ei,
bounds=bounds,
options={"maxiter_continuous": 32},
),
discrete_dims=binary_dims,
current_x=invalid_X,
)

def test_optimize_acqf_mixed_binary_only(self) -> None:
train_X, train_Y, binary_dims, cont_dims = self._get_data()
dim = len(binary_dims) + len(cont_dims)
Expand Down

0 comments on commit b6e7ee0

Please sign in to comment.