saealib.CompositeSurrogateManager¶
- class saealib.CompositeSurrogateManager(managers, combine_fn)[source]¶
Bases:
SurrogateManagerSurrogate manager that combines scores from multiple sub-managers.
Each sub-manager’s
score_candidatesis called independently. The resulting score arrays are combined bycombine_fn. Predictions (fortell_fassignment) are taken frommanagers[0].- Parameters:
managers (list[SurrogateManager]) – Sub-managers to combine. Must be non-empty.
managers[0]provides theSurrogatePredictionobjects returned byscore_candidates; its predicted objective values flow intoassign_tell_fin the strategies.combine_fn (callable(list[np.ndarray]) -> np.ndarray) – Accepts a list of score arrays (each shape
(n_candidates,)) and returns a single combined score array of the same shape. Useproduct_combine()for element-wise product (e.g. EI x PoF) orrank_weighted_combine()for rank-normalised weighted average.
Examples
EI x PoF (objective x feasibility product):
>>> manager = CompositeSurrogateManager( ... [ei_manager, pof_manager], ... combine_fn=product_combine, ... )
Rank-normalised ensemble (equivalent to former EnsembleSurrogateManager):
>>> manager = CompositeSurrogateManager( ... [m1, m2], ... combine_fn=rank_weighted_combine(weights=[0.3, 0.7]), ... )
Methods
Combine scores from all sub-managers using |
Method Details
- CompositeSurrogateManager.__init__(managers, combine_fn)[source]¶
- Parameters:
managers (list[SurrogateManager])
combine_fn (Callable[[list[ndarray]], ndarray])
- CompositeSurrogateManager.score_candidates(candidates_x, archive, provider=None, ctx=None)[source]¶
Combine scores from all sub-managers using
combine_fn.Returns the predictions from
managers[0]as representative.- Parameters:
candidates_x (np.ndarray)
archive (Archive)
provider (ComponentProvider | None)
ctx (OptimizationContext | None)
- Return type:
tuple[np.ndarray, list[SurrogatePrediction]]