saealib.CompositeSurrogateManager#

class saealib.CompositeSurrogateManager(managers)[ソース]#

ベースクラス: SurrogateManager

Surrogate manager that composes predictions from multiple named sub-managers.

This manager owns named child managers, calls each child's predict(), and returns a single SurrogatePrediction whose channels mapping contains one named PredictionChannel per child. It never combines acquisition scores itself -- pair it with CompositeAcquisition, 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 in predict()'s result.

Methods

__init__

contract

Return the surrogate-manager contract.

fit

Pre-fit all sub-managers.

on_generation_end

End-of-generation hook; override to update internal state.

predict

Predict via every sub-manager, one named channel each.

with_on_generation_end

Return a copy of this manager with fn appended to the hook.

Method Details

CompositeSurrogateManager.__init__(managers)[ソース]#
パラメータ:

managers (dict[str, SurrogateManager])

CompositeSurrogateManager.contract()#

Return the surrogate-manager contract.

戻り値の型:

ComponentContract

CompositeSurrogateManager.fit(archive, ctx=None)[ソース]#

Pre-fit all sub-managers.

last_accuracy is 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.

戻り値:

channels maps each configuration key to a PredictionChannel built from that sub-manager's own value/std (i.e. its own primary/objective channel). If a sub-manager's predict() exposes no "objective" channel, accessing .value/.std raises KeyError -- a genuine misconfiguration, not handled defensively here.

戻り値の型:

SurrogatePrediction

パラメータ:
  • candidates_x (np.ndarray)

  • archive (Archive)

  • ctx (OptimizationState | None)

  • refit (bool)

CompositeSurrogateManager.with_on_generation_end(fn)#

Return a copy of this manager with fn appended to the hook.

パラメータ:

fn (callable) -- fn(gen, archive, ctx) -> None

戻り値:

Shallow copy with the hook registered.

戻り値の型:

SurrogateManager