saealib.ExpectedImprovement#
- class saealib.ExpectedImprovement(xi=0.01, obj_idx=0, reference=None, direction=None)[ソース]#
ベースクラス:
PointwiseAcquisitionExpected Improvement (EI) acquisition function.
EI balances exploration and exploitation by computing the expected amount of improvement over the current best observed value.
For single-objective minimization:
EI(x) = E[max(f_best - f(x), 0)] = (f_best - mu) * Phi(Z) + sigma * phi(Z) where Z = (f_best - mu) / sigma
Requires a surrogate that provides uncertainty estimates (std).
- パラメータ:
xi (float) -- Exploration-exploitation trade-off parameter. Higher values encourage more exploration. Default: 0.01.
obj_idx (int) -- Index of the objective to optimize. Used for multi-objective problems where EI is applied to a single objective. Default: 0.
direction (np.ndarray or None) -- Per-objective optimization direction (+1 = maximize, -1 = minimize). shape: (n_obj,).
archive.f, a user-suppliedreference, and the predicted mean are converted to minimize-space viadirection_to_minimize_signbefore the (minimize-only) EI formula above runs.None(default) means already-minimize; when unset, it is auto-injected fromproblem.directionat run start.reference (Any)
参照
[24]: Jones, D. R., Schonlau, M., & Welch, W. J. (1998). Efficient global optimization of expensive black-box functions. Journal of Global Optimization, 13(4), 455-492.
Methods
Return fixed reference if set, otherwise component-wise best from archive. |
|
Return the pointwise acquisition contract. |
|
Reject |
|
Delegate to |
|
Compute Expected Improvement scores. |
Method Details
- ExpectedImprovement.__init__(xi=0.01, obj_idx=0, reference=None, direction=None)[ソース]#
- パラメータ:
xi (float)
obj_idx (int)
reference (Any)
direction (ndarray | None)
- ExpectedImprovement.compute_reference(archive, rng=None)[ソース]#
Return fixed reference if set, otherwise component-wise best from archive.
- パラメータ:
archive (Archive)
rng (np.random.Generator | None)
- 戻り値の型:
np.ndarray
- ExpectedImprovement.contract()#
Return the pointwise acquisition contract.
- 戻り値の型:
- ExpectedImprovement.evaluate(candidates_x, prediction, archive, ctx=None, *, prepared=<object object>)#
Reject
prediction is None, resolve the reference, thenscore().See
AcquisitionFunction.evaluate()for the shared parameter contract, including the_UNSETvs. explicitprepared=Nonedistinction.- パラメータ:
candidates_x (np.ndarray)
prediction (SurrogatePrediction | None)
archive (Archive)
ctx (OptimizationState | None)
prepared (Any)
- 戻り値の型:
AcquisitionResult
- ExpectedImprovement.prepare(archive, ctx=None)#
Delegate to
compute_reference(archive, rng=ctx.rng if ctx else None).- パラメータ:
archive (Archive)
ctx (OptimizationState | None)
- 戻り値の型:
Any
- ExpectedImprovement.score(prediction, reference, rng=None)[ソース]#
Compute Expected Improvement scores.
- パラメータ:
prediction (SurrogatePrediction) -- Surrogate predictions. Must have std (has_uncertainty == True).
reference (Any) -- Current best objective value. Scalar or ndarray of shape (n_obj,). The objective at index obj_idx is used.
rng (Generator | None)
- 戻り値:
EI scores. shape: (n_samples,). Higher is better.
- 戻り値の型:
np.ndarray
- 例外:
TypeError -- If prediction does not contain uncertainty estimates.