p2pfl.learning.frameworks.callback_factory moduleΒΆ
P2PFLCallback factory.
- class p2pfl.learning.frameworks.callback_factory.CallbackFactory[source]ΒΆ
Bases:
object
Factory for creating callbacks based on learner framework and aggregator requirements.
- classmethod create_callbacks(framework, aggregator)[source]ΒΆ
Create the callbacks required by the aggregator for the given learner.
- Parameters:
framework (
str
) β The framework of the learner.aggregator (Any) β The aggregator instance.
- Return type:
List
[P2PFLCallback
]
- classmethod register_callback(learner, callback)[source]ΒΆ
Register a callback constructor for a given learner framework and callback key.
- Parameters:
learner (
str
) β The learner instance (e.g., βKerasLearnerβ, βLightningLearnerβ).callback (
Type
[P2PFLCallback
]) β A callback.