saealib.SurrogateOnlyLoopStage#

class saealib.SurrogateOnlyLoopStage(algorithm, surrogate_manager, gen_ctrl, cbmanager=None, *, acquisition, feedback_builder=None)[ソース]#

ベースクラス: Stage

Run gen_ctrl surrogate-only generations before real evaluation.

Fits the surrogate model once on the current archive, then repeats gen_ctrl times: CountGeneration → Ask → SurrogatePredict(refit=False) → Acquisition → Tell. If gen_ctrl is 0 this stage is a no-op.

Used by GenerationBasedStrategy to execute inner surrogate-driven generations before a single true-evaluation generation.

パラメータ:
  • algorithm (Algorithm) -- Evolutionary algorithm for ask/tell.

  • surrogate_manager (SurrogateManager) -- Manager used for fitting and prediction.

  • gen_ctrl (int) -- Number of surrogate-only generations.

  • cbmanager (CallbackManager or None) -- Forwarded to inner stages for event dispatching.

  • acquisition (AcquisitionFunction) -- Acquisition function used to score offspring inside the inner loop. Keyword-only so existing positional SurrogateOnlyLoopStage(algorithm, surrogate_manager, gen_ctrl, cbmanager) calls stay valid.

  • feedback_builder (FeedbackBuilder | None)

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 as a \For loop block when expand is True.

to_text

Render this stage as a plain-text algorithmic line.

Method Details

SurrogateOnlyLoopStage.__init__(algorithm, surrogate_manager, gen_ctrl, cbmanager=None, *, acquisition, feedback_builder=None)[ソース]#

Initialize base Stage attributes.

パラメータ:
戻り値の型:

None

SurrogateOnlyLoopStage.contract()[ソース]#

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

戻り値の型:

ComponentContract

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

Execute this stage and return the updated state.

パラメータ:

state (OptimizationState) -- Current optimization state.

戻り値:

Updated state.

戻り値の型:

OptimizationState

SurrogateOnlyLoopStage.to_pseudocode(*, expand=False, indent=0)[ソース]#

Render as a \For loop block when expand is True.

パラメータ:
  • expand (bool)

  • indent (int)

戻り値の型:

str

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

Render this stage as a plain-text algorithmic line.

パラメータ:
  • expand (bool)

  • indent (int)

戻り値の型:

str