saealib.AcquisitionFunction#

class saealib.AcquisitionFunction[source]#

Bases: ABC

Abstract base class for acquisition functions (infill criteria).

An acquisition function converts a SurrogatePrediction (and/or the Archive) into a scalar score per candidate, which is used to rank candidates for true evaluation. It is completely decoupled from Surrogate/SurrogateManager: it knows nothing about how predictions are generated.

Methods

__init__

contract

Return the acquisition contract.

evaluate

Compute acquisition scores for a set of candidates.

prepare

Compute a generation-scoped reference value shared across evaluate() calls.

Method Details

AcquisitionFunction.__init__()#
AcquisitionFunction.contract()[source]#

Return the acquisition contract.

Return type:

ComponentContract

abstractmethod AcquisitionFunction.evaluate(candidates_x, prediction, archive, ctx=None, *, prepared=<object object>)[source]#

Compute acquisition scores for a set of candidates.

Parameters:
  • candidates_x (np.ndarray) – Candidate design vectors. shape: (n_candidates, dim).

  • prediction (SurrogatePrediction or None) – Surrogate predictions for candidates_x, or None for an archive-only acquisition that needs no prediction.

  • archive (Archive) – Archive of evaluated solutions.

  • ctx (OptimizationState or None, optional) – Optimization state, used here only for ctx.rng.

  • prepared (Any, optional) – A previously computed reference value, as returned by prepare(). The default sentinel _UNSET means “compute it now via prepare(archive, ctx)”; an explicit None is a valid prepared value in its own right and skips prepare().

Returns:

scores is an owned (n_candidates,) float64 array; higher is better.

Return type:

AcquisitionResult

AcquisitionFunction.prepare(archive, ctx=None)[source]#

Compute a generation-scoped reference value shared across evaluate() calls.

Concrete hook returning None by default. PointwiseAcquisition overrides it with the compute_reference() behavior; archive-only acquisitions need not override it.

Parameters:
  • archive (Archive) – Archive of evaluated solutions.

  • ctx (OptimizationState or None, optional) – Optimization state, used here only for ctx.rng.

Returns:

A prepared reference value, passed to evaluate(..., prepared=...).

Return type:

Any