Model Ensemble¶
SimpleEnsembleAlgorithm
¶
Bases: BaseAlgorithm
Source code in fusion_bench/method/ensemble.py
__init__(device_map=None, **kwargs)
¶
Initializes the SimpleEnsembleAlgorithm with an optional device map.
Parameters:
-
device_map(Optional[Mapping[int, Union[str, device]]], default:None) –A mapping from model index to device. Defaults to None.
Source code in fusion_bench/method/ensemble.py
run(modelpool)
¶
Run the simple ensemble algorithm on the given model pool.
Parameters:
-
modelpool(BaseModelPool | List[Module]) –The pool of models to ensemble.
Returns:
-
EnsembleModule(EnsembleModule) –The ensembled model.
Source code in fusion_bench/method/ensemble.py
WeightedEnsembleAlgorithm
¶
Bases: BaseAlgorithm
Source code in fusion_bench/method/ensemble.py
run(modelpool)
¶
Run the weighted ensemble algorithm on the given model pool.
Parameters:
-
modelpool(BaseModelPool | List[Module]) –The pool of models to ensemble.
Returns:
-
WeightedEnsembleModule(WeightedEnsembleModule) –The weighted ensembled model.
Source code in fusion_bench/method/ensemble.py
MaxModelPredictorAlgorithm
¶
Bases: BaseAlgorithm
Source code in fusion_bench/method/ensemble.py
run(modelpool)
¶
Run the max model predictor algorithm on the given model pool.
Parameters:
-
modelpool(BaseModelPool | List[Module]) –The pool of models to ensemble.
Returns:
-
MaxModelPredictor(MaxModelPredictor) –The max model predictor ensembled model.