From b6e7ee0f97b5b5d15341fac80cccf951b9ba2c01 Mon Sep 17 00:00:00 2001 From: Sait Cakmak Date: Thu, 16 Jan 2025 12:16:35 -0500 Subject: [PATCH] remove validation --- botorch/optim/optimize_mixed.py | 2 -- test/optim/test_optimize_mixed.py | 17 ----------------- 2 files changed, 19 deletions(-) diff --git a/botorch/optim/optimize_mixed.py b/botorch/optim/optimize_mixed.py index 105952b3b9..5cbf2227cc 100644 --- a/botorch/optim/optimize_mixed.py +++ b/botorch/optim/optimize_mixed.py @@ -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)) diff --git a/test/optim/test_optimize_mixed.py b/test/optim/test_optimize_mixed.py index f358f0a537..7e2c006a38 100644 --- a/test/optim/test_optimize_mixed.py +++ b/test/optim/test_optimize_mixed.py @@ -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)