Skip to content

Commit 9684e1d

Browse files
authored
Merge branch 'main' into np_regression
2 parents 50fe7a1 + 851df1f commit 9684e1d

File tree

17 files changed

+1034
-278
lines changed

17 files changed

+1034
-278
lines changed

botorch/acquisition/input_constructors.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,7 +1758,7 @@ def optimize_objective(
17581758
columns=list(fixed_features.keys()),
17591759
values=list(fixed_features.values()),
17601760
)
1761-
free_feature_dims = list(range(len(bounds)) - fixed_features.keys())
1761+
free_feature_dims = list(range(bounds.shape[1]) - fixed_features.keys())
17621762
free_feature_bounds = bounds[:, free_feature_dims] # (2, d' <= d)
17631763
else:
17641764
free_feature_bounds = bounds
@@ -1775,18 +1775,21 @@ def optimize_objective(
17751775
rhs = -b[i, 0]
17761776
inequality_constraints.append((indices, coefficients, rhs))
17771777

1778+
options = {
1779+
"batch_limit": optimizer_options.get("batch_limit", 8),
1780+
"maxiter": optimizer_options.get("maxiter", 200),
1781+
"nonnegative": optimizer_options.get("nonnegative", False),
1782+
}
1783+
if "method" in optimizer_options:
1784+
options["method"] = optimizer_options.pop("method")
1785+
17781786
return optimize_acqf(
17791787
acq_function=acq_function,
17801788
bounds=free_feature_bounds,
17811789
q=q,
17821790
num_restarts=optimizer_options.get("num_restarts", 60),
17831791
raw_samples=optimizer_options.get("raw_samples", 1024),
1784-
options={
1785-
"batch_limit": optimizer_options.get("batch_limit", 8),
1786-
"maxiter": optimizer_options.get("maxiter", 200),
1787-
"nonnegative": optimizer_options.get("nonnegative", False),
1788-
"method": optimizer_options.get("method", "L-BFGS-B"),
1789-
},
1792+
options=options,
17901793
inequality_constraints=inequality_constraints,
17911794
fixed_features=None, # handled inside the acquisition function
17921795
post_processing_func=post_processing_func,

botorch/acquisition/joint_entropy_search.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from botorch import settings
3030
from botorch.acquisition.acquisition import AcquisitionFunction, MCSamplerMixin
3131
from botorch.acquisition.objective import PosteriorTransform
32-
from botorch.models.fully_bayesian import SaasFullyBayesianSingleTaskGP
32+
from botorch.models.fully_bayesian import FullyBayesianSingleTaskGP
3333
from botorch.models.model import Model
3434
from botorch.models.utils import check_no_nans, fantasize as fantasize_flag
3535
from botorch.models.utils.gpytorch_modules import MIN_INFERRED_NOISE_LEVEL
@@ -124,7 +124,7 @@ def __init__(
124124
# and the optimal outputs have shapes num_optima x [num_models if FB] x 1 x 1
125125
# The third dimension equaling 1 is required to get one optimum per model,
126126
# which raises a BotorchTensorDimensionWarning.
127-
if isinstance(model, SaasFullyBayesianSingleTaskGP):
127+
if isinstance(model, FullyBayesianSingleTaskGP):
128128
raise NotImplementedError(FULLY_BAYESIAN_ERROR_MSG)
129129
with warnings.catch_warnings():
130130
warnings.filterwarnings("ignore")

0 commit comments

Comments
 (0)