qLogNoisyExpectedHypervolumeImprovement¶
- class baybe.acquisition.acqfs.qLogNoisyExpectedHypervolumeImprovement[source]¶
Bases:
_ExpectedHypervolumeImprovement
Logarithmic Monte Carlo based noisy expected hypervolume improvement.
Public methods
__init__
([reference_point, prune_baseline])Method generated by attrs for class qLogNoisyExpectedHypervolumeImprovement.
compute_ref_point
(array, maximize[, factor])Compute a reference point for a given set of target configurations.
evaluate
(candidates, surrogate, searchspace, ...)Get the acquisition values for the given candidates.
from_dict
(dictionary)Create an object from its dictionary representation.
from_json
(string)Create an object from its JSON representation.
to_botorch
(surrogate, searchspace, ...[, ...])Create the botorch-ready representation of the function.
to_dict
()Create an object's dictionary representation.
to_json
()Create an object's JSON representation.
Public attributes and properties
An alternative name for type resolution.
Auto-prune candidates that are unlikely to be the best.
The reference point for computing the hypervolume improvement.
Whether this acquisition function can handle models with multiple outputs.
- __init__(reference_point: ConvertibleToFloat | Iterable[ConvertibleToFloat] | None = None, prune_baseline: bool = True)¶
Method generated by attrs for class qLogNoisyExpectedHypervolumeImprovement.
For details on the parameters, see Public attributes and properties.
- static compute_ref_point(array: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], maximize: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], factor: float = 0.1)¶
Compute a reference point for a given set of target configurations.
The reference point is positioned relative to the worst point in the direction coming from the best point:
A factor of 0.0 results in the reference point being the worst point.
A factor > 0.0 moves the reference point further away from both worst and best points. (A factor of 1.0 exactly mirrors the best around the worst point.)
A factor < 0.0 moves the reference point closer to the best point. (A factor of -1.0 exactly places the reference point onto the best point.)
Example
>>> from baybe.acquisition import qLogNEHVI
>>> qLogNEHVI.compute_ref_point([[0, 10], [2, 20]], [True, True], 0.1) array([-0.2, 9. ])
>>> qLogNEHVI.compute_ref_point([[0, 10], [2, 20]], [True, False], 0.2) array([-0.4, 22. ])
- Parameters:
array (
Union
[_Buffer
,_SupportsArray
[dtype
[Any
]],_NestedSequence
[_SupportsArray
[dtype
[Any
]]],bool
,int
,float
,complex
,str
,bytes
,_NestedSequence
[bool
|int
|float
|complex
|str
|bytes
]]) – A 2-D array-like where each row represents a target configuration.maximize (
Union
[_Buffer
,_SupportsArray
[dtype
[Any
]],_NestedSequence
[_SupportsArray
[dtype
[Any
]]],bool
,int
,float
,complex
,str
,bytes
,_NestedSequence
[bool
|int
|float
|complex
|str
|bytes
]]) – A 1-D boolean array indicating which targets are to be maximized.factor (
float
) – A numeric value controlling the location of the reference point.
- Raises:
ValueError – If the given target configuration array is not two-dimensional.
ValueError – If the given Boolean array is not one-dimensional.
- Return type:
- Returns:
The computed reference point.
- evaluate(candidates: DataFrame, surrogate: SurrogateProtocol, searchspace: SearchSpace, objective: Objective, measurements: DataFrame, pending_experiments: DataFrame | None = None, *, jointly: bool = False)¶
Get the acquisition values for the given candidates.
- Parameters:
candidates (
DataFrame
) – The candidate points in experimental representation. For details, seebaybe.surrogates.base.Surrogate.posterior()
.surrogate (
SurrogateProtocol
) – The surrogate model to use for the acquisition function.searchspace (
SearchSpace
) – The search space. Seebaybe.recommenders.base.RecommenderProtocol.recommend()
.objective (
Objective
) – The objective. Seebaybe.recommenders.base.RecommenderProtocol.recommend()
.measurements (
DataFrame
) – Available experimentation data. Seebaybe.recommenders.base.RecommenderProtocol.recommend()
.pending_experiments (
Optional
[DataFrame
]) – Optional pending experiments. Seebaybe.recommenders.base.RecommenderProtocol.recommend()
.jointly (
bool
) – IfFalse
, the acquisition values are computed independently for each candidate. IfTrue
, a single joint acquisition value is computed for the entire candidate set.
- Return type:
- Returns:
Depending on the joint mode, either a single batch acquisition value or a series of individual acquisition values.
- to_botorch(surrogate: SurrogateProtocol, searchspace: SearchSpace, objective: Objective, measurements: DataFrame, pending_experiments: DataFrame | None = None)¶
Create the botorch-ready representation of the function.
The required structure of measurements is specified in
baybe.recommenders.base.RecommenderProtocol.recommend()
.- Return type:
- to_json()¶
Create an object’s JSON representation.
- Return type:
- Returns:
The JSON representation as a string.
-
reference_point:
float
|tuple
[float
,...
] |None
¶ The reference point for computing the hypervolume improvement.
When omitted, a default reference point is computed based on the provided data.
When specified as a float, the value is interpreted as a multiplicative factor determining the reference point location based on the difference between the best and worst target configuration in the provided data.
When specified as an iterable, the contained values are directly interpreted as the coordinates of the reference point.