saealib.AcquisitionStage#

class saealib.AcquisitionStage(acquisition, cbmanager=None)[ソース]#

ベースクラス: Stage

Score offspring via an independent AcquisitionFunction.

Reads state.offspring/state.predictions, writes the resulting score array to state.scores.

Caches acquisition.prepare()'s result per (acquisition instance identity, generation, decision_count, archive.value_version, archive.structure_version). A stage instance running the same acquisition against an unchanged archive within one generation does not recompute the reference, while a mid-generation archive append (structure_version bump), value-only mutation (value_version bump), or a newly confirmed evaluation plan (decision_count bump -- relevant to async steady-state refill, where gen can stay fixed across several confirmed plans) correctly invalidates it.

Empty candidate input (len(state.offspring) == 0) skips straight to an empty AcquisitionResult without touching the cache or calling prepare()/evaluate(), so it never advances RNG state.

パラメータ:
  • acquisition (AcquisitionFunction) -- Acquisition function that scores state.offspring against state.predictions.

  • cbmanager (CallbackManager or None) -- If provided, AcquisitionStartEvent and AcquisitionEndEvent are dispatched. AcquisitionEndEvent is not dispatched if acquisition.evaluate() raises.

Methods

__init__

Initialize base Stage attributes.

contract

Return this stage's structural and direct state-access contract.

execute

Execute this stage and return the updated state.

to_pseudocode

Render this stage as a LaTeX algorithmic line.

to_text

Render this stage as a plain-text algorithmic line.

Method Details

AcquisitionStage.__init__(acquisition, cbmanager=None)[ソース]#

Initialize base Stage attributes.

パラメータ:
  • name (str, optional) -- Override the class-level name.

  • label (str, optional) -- Override the class-level label.

  • notation (str, optional) -- Override the class-level notation.

  • acquisition (AcquisitionFunction)

  • cbmanager (CallbackManager | None)

戻り値の型:

None

AcquisitionStage.contract()[ソース]#

Return this stage's structural and direct state-access contract.

戻り値の型:

ComponentContract

AcquisitionStage.execute(state)[ソース]#

Execute this stage and return the updated state.

パラメータ:

state (OptimizationState) -- Current optimization state.

戻り値:

Updated state.

戻り値の型:

OptimizationState

AcquisitionStage.to_pseudocode(*, expand=False, indent=0)#

Render this stage as a LaTeX algorithmic line.

パラメータ:
  • expand (bool) -- If True and this stage has sub-stages, recursively expand them.

  • indent (int) -- Current indentation level (number of \State indent steps).

戻り値:

LaTeX algorithmic fragment.

戻り値の型:

str

AcquisitionStage.to_text(*, expand=False, indent=0)#

Render this stage as a plain-text algorithmic line.

パラメータ:
  • expand (bool)

  • indent (int)

戻り値の型:

str