saealib.SurrogateOnlyLoopStage#
- class saealib.SurrogateOnlyLoopStage(algorithm, surrogate_manager, gen_ctrl, cbmanager=None, *, acquisition, feedback_builder=None)[source]#
Bases:
StageRun gen_ctrl surrogate-only generations before real evaluation.
Fits the surrogate model once on the current archive, then repeats
gen_ctrltimes: CountGeneration → Ask → SurrogatePredict(refit=False) → Acquisition → Tell. If gen_ctrl is 0 this stage is a no-op.Used by
GenerationBasedStrategyto execute inner surrogate-driven generations before a single true-evaluation generation.- Parameters:
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
Initialize base Stage attributes. |
|
Return this stage's structural and direct state-access contract. |
|
Execute this stage and return the updated state. |
|
Render as a |
|
Render this stage as a plain-text algorithmic line. |
Method Details
- SurrogateOnlyLoopStage.__init__(algorithm, surrogate_manager, gen_ctrl, cbmanager=None, *, acquisition, feedback_builder=None)[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.algorithm (Algorithm)
surrogate_manager (SurrogateManager)
gen_ctrl (int)
cbmanager (CallbackManager | None)
acquisition (AcquisitionFunction)
feedback_builder (FeedbackBuilder | None)
- Return type:
None
- SurrogateOnlyLoopStage.contract()[source]#
Return this stage’s structural and direct state-access contract.
- Return type:
- SurrogateOnlyLoopStage.execute(state)[source]#
Execute this stage and return the updated state.
- Parameters:
state (OptimizationState) – Current optimization state.
- Returns:
Updated state.
- Return type:
OptimizationState
- SurrogateOnlyLoopStage.to_pseudocode(*, expand=False, indent=0)[source]#
Render as a
\Forloop block when expand is True.- Parameters:
expand (bool)
indent (int)
- Return type:
str
- SurrogateOnlyLoopStage.to_text(*, expand=False, indent=0)#
Render this stage as a plain-text algorithmic line.
- Parameters:
expand (bool)
indent (int)
- Return type:
str