Skip to content

Commit

Permalink
Merge ccd2b1e into 4d219d6
Browse files Browse the repository at this point in the history
  • Loading branch information
hvarfner authored Apr 23, 2023
2 parents 4d219d6 + ccd2b1e commit 5a9873e
Show file tree
Hide file tree
Showing 9 changed files with 707 additions and 252 deletions.
37 changes: 37 additions & 0 deletions botorch/acquisition/input_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
)
from botorch.acquisition.cost_aware import InverseCostWeightedUtility
from botorch.acquisition.fixed_feature import FixedFeatureAcquisitionFunction
from botorch.acquisition.joint_entropy_search import qJointEntropySearch
from botorch.acquisition.knowledge_gradient import (
qKnowledgeGradient,
qMultiFidelityKnowledgeGradient,
Expand Down Expand Up @@ -82,6 +83,7 @@
from botorch.acquisition.risk_measures import RiskMeasureMCObjective
from botorch.acquisition.utils import (
expand_trace_observations,
get_optimal_samples,
project_to_target_fidelity,
)
from botorch.exceptions.errors import UnsupportedError
Expand Down Expand Up @@ -1239,3 +1241,38 @@ def optimize_objective(
return_best_only=True,
sequential=sequential,
)


@acqf_input_constructor(qJointEntropySearch)
def construct_inputs_qJES(
model: Model,
training_data: MaybeDict[SupervisedDataset],
bounds: Tensor,
num_optima: int = 64,
maximize: bool = True,
condition_noiseless: bool = True,
X_pending: Optional[Tensor] = None,
estimation_type: str = "LB",
num_samples: int = 64,
**kwargs: Any,
):
dtype = model.train_targets.dtype
optimal_inputs, optimal_outputs = get_optimal_samples(
model=model,
bounds=torch.as_tensor(bounds, dtype=dtype).T,
num_optima=num_optima,
maximize=maximize,
)

inputs = {
"model": model,
"optimal_inputs": optimal_inputs,
"optimal_outputs": optimal_outputs,
"condition_noiseless": condition_noiseless,
"maximize": maximize,
"X_pending": X_pending,
"estimation_type": estimation_type,
"num_samples": num_samples,
**kwargs,
}
return inputs
Loading

0 comments on commit 5a9873e

Please sign in to comment.