saealib.AccuracyBasedSurrogateSwitcher#
- class saealib.AccuracyBasedSurrogateSwitcher[ソース]#
ベースクラス:
ABC,Generic[T]Abstract base for accuracy-driven module and parameter switching.
Implementations return a replacement surrogate manager, optimization strategy, or numeric parameter based on the most recent accuracy snapshot. Call
switch()inside aniterate()loop and apply the result:switcher = StrategySwitcher(ps_strategy, ib_strategy) for ctx in optimizer.iterate(): optimizer.set_strategy( switcher.switch(optimizer.surrogate_manager.last_accuracy) )
Methods
Method Details
- AccuracyBasedSurrogateSwitcher.__init__()#
- abstractmethod AccuracyBasedSurrogateSwitcher.switch(accuracy)[ソース]#
Return the replacement value for the next step.
- パラメータ:
accuracy (SurrogateAccuracy or None) -- Most recent accuracy snapshot from
surrogate_manager.last_accuracy.Noneon the first step or when no accuracy evaluator is configured.- 戻り値:
Replacement module or parameter value.
- 戻り値の型:
T