saealib.CompositeSurrogateManager#
- class saealib.CompositeSurrogateManager(managers)[ソース]#
ベースクラス:
SurrogateManagerSurrogate manager that composes predictions from multiple named sub-managers.
This manager owns named child managers, calls each child's
predict(), and returns a singleSurrogatePredictionwhosechannelsmapping contains one namedPredictionChannelper child. It never combines acquisition scores itself -- pair it withCompositeAcquisition, which evaluates each configured channel's acquisition and combines the resulting score arrays:ei_manager = GlobalSurrogateManager(GP()) pof_manager = GlobalSurrogateManager( PerObjectiveSurrogate([GP()] * n_constraints) ) composite_acq = CompositeAcquisition( { "objective": ExpectedImprovement(), "feasibility": ProductOfFeasibility(), }, combine_fn=product_combine, ) surrogate_manager = CompositeSurrogateManager( {"objective": ei_manager, "feasibility": pof_manager}, )
- パラメータ:
managers (dict[str, SurrogateManager]) -- Named sub-managers to compose. Must be non-empty. Each key becomes the corresponding
PredictionChannel's name inpredict()'s result.
Methods
Return the surrogate-manager contract. |
|
Pre-fit all sub-managers. |
|
End-of-generation hook; override to update internal state. |
|
Predict via every sub-manager, one named channel each. |
|
Return a copy of this manager with |
Method Details
- CompositeSurrogateManager.__init__(managers)[ソース]#
- パラメータ:
managers (dict[str, SurrogateManager])
- CompositeSurrogateManager.contract()#
Return the surrogate-manager contract.
- 戻り値の型:
- CompositeSurrogateManager.fit(archive, ctx=None)[ソース]#
Pre-fit all sub-managers.
last_accuracyis propagated from the first sub-manager (in configuration insertion order) so callers can read a representative accuracy value from this composite manager.- パラメータ:
archive (Archive)
ctx (OptimizationState | None)
- 戻り値の型:
None
- CompositeSurrogateManager.on_generation_end(gen, archive, ctx=None)#
End-of-generation hook; override to update internal state.
- パラメータ:
gen (int)
archive (Archive)
ctx (OptimizationState | None)
- 戻り値の型:
None
- CompositeSurrogateManager.predict(candidates_x, archive, ctx=None, *, refit=True)[ソース]#
Predict via every sub-manager, one named channel each.
- 戻り値:
channelsmaps each configuration key to aPredictionChannelbuilt from that sub-manager's ownvalue/std(i.e. its own primary/objective channel). If a sub-manager'spredict()exposes no"objective"channel, accessing.value/.stdraisesKeyError-- a genuine misconfiguration, not handled defensively here.- 戻り値の型:
- パラメータ:
candidates_x (np.ndarray)
archive (Archive)
ctx (OptimizationState | None)
refit (bool)
- CompositeSurrogateManager.with_on_generation_end(fn)#
Return a copy of this manager with
fnappended to the hook.- パラメータ:
fn (callable) --
fn(gen, archive, ctx) -> None- 戻り値:
Shallow copy with the hook registered.
- 戻り値の型: