saealib.ExpectedImprovement#

class saealib.ExpectedImprovement(xi=0.01, obj_idx=0, reference=None, direction=None)[ソース]#

ベースクラス: PointwiseAcquisition

Expected 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-supplied reference, and the predicted mean are converted to minimize-space via direction_to_minimize_sign before the (minimize-only) EI formula above runs. None (default) means already-minimize; when unset, it is auto-injected from problem.direction at 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

__init__

compute_reference

Return fixed reference if set, otherwise component-wise best from archive.

contract

Return the pointwise acquisition contract.

evaluate

Reject prediction is None, resolve the reference, then score().

prepare

Delegate to compute_reference(archive, rng=ctx.rng if ctx else None).

score

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.

戻り値の型:

ComponentContract

ExpectedImprovement.evaluate(candidates_x, prediction, archive, ctx=None, *, prepared=<object object>)#

Reject prediction is None, resolve the reference, then score().

See AcquisitionFunction.evaluate() for the shared parameter contract, including the _UNSET vs. explicit prepared=None distinction.

パラメータ:
  • 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.