saealib.SurrogatePredictStage#

class saealib.SurrogatePredictStage(surrogate_manager, cbmanager=None, *, refit=True)[source]#

Bases: Stage

Predict offspring with the surrogate model.

Reads state.offspring, writes the batched prediction to state.predictions. Also assigns predicted objective values TellStage receives feedback from a separate policy. Does not compute acquisition scores; pair with AcquisitionStage for that.

Parameters:
  • surrogate_manager (SurrogateManager) – Manager that coordinates fit / predict.

  • cbmanager (CallbackManager or None) – If provided, SurrogateStartEvent and SurrogateEndEvent are dispatched.

  • refit (bool) – Passed directly to surrogate_manager.predict(). Set to False inside inner loops where the surrogate was already fitted by an explicit SurrogateFitStage.

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

SurrogatePredictStage.__init__(surrogate_manager, cbmanager=None, *, refit=True)[source]#

Initialize base Stage attributes.

Parameters:
  • name (str, optional) – Override the class-level name.

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

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

  • surrogate_manager (SurrogateManager)

  • cbmanager (CallbackManager | None)

  • refit (bool)

Return type:

None

SurrogatePredictStage.contract()[source]#

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

Return type:

ComponentContract

SurrogatePredictStage.execute(state)[source]#

Execute this stage and return the updated state.

Parameters:

state (OptimizationState) – Current optimization state.

Returns:

Updated state.

Return type:

OptimizationState

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

Render this stage as a LaTeX algorithmic line.

Parameters:
  • expand (bool) – If True and this stage has sub-stages, recursively expand them.

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

Returns:

LaTeX algorithmic fragment.

Return type:

str

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

Render this stage as a plain-text algorithmic line.

Parameters:
  • expand (bool)

  • indent (int)

Return type:

str