Skip to content

Commit

Permalink
Import botorch.acquisition as bo_acqf
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSosic committed Aug 21, 2024
1 parent 51c8b62 commit bc48ec4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions baybe/acquisition/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def to_botorch(
The required structure of `measurements` is specified in
:meth:`baybe.recommenders.base.RecommenderProtocol.recommend`.
"""
import botorch.acquisition as bacqf
import botorch.acquisition as bo_acqf
import torch
from botorch.acquisition.objective import LinearMCObjective

Expand All @@ -66,7 +66,7 @@ def to_botorch(
train_y = objective.transform(measurements)

# Retrieve corresponding botorch class
acqf_cls = getattr(bacqf, self.__class__.__name__)
acqf_cls = getattr(bo_acqf, self.__class__.__name__)

# Match relevant attributes
params_dict = match_attributes(
Expand All @@ -91,9 +91,9 @@ def to_botorch(
if "best_f" in signature_params:
additional_params["best_f"] = train_y.min().item()

if issubclass(acqf_cls, bacqf.AnalyticAcquisitionFunction):
if issubclass(acqf_cls, bo_acqf.AnalyticAcquisitionFunction):
additional_params["maximize"] = False
elif issubclass(acqf_cls, bacqf.MCAcquisitionFunction):
elif issubclass(acqf_cls, bo_acqf.MCAcquisitionFunction):
additional_params["objective"] = LinearMCObjective(
torch.tensor([-1.0])
)
Expand Down

0 comments on commit bc48ec4

Please sign in to comment.