nvflare.app_common.app_defined.aggregator module¶
- class AppDefinedAggregator[source]¶
Bases:
Aggregator
,ComponentBase
,ABC
Init FLComponent.
The FLComponent is the base class of all FL Components. (executors, controllers, responders, filters, aggregators, and widgets are all FLComponents)
FLComponents have the capability to handle and fire events and contain various methods for logging.
- accept(shareable: Shareable, fl_ctx: FLContext) bool [source]¶
Accept the shareable submitted by the client.
- Parameters:
shareable – submitted Shareable object
fl_ctx – FLContext
- Returns:
first boolean to indicate if the contribution has been accepted.
- aggregate(fl_ctx: FLContext) Shareable [source]¶
Perform the aggregation for all the received Shareable from the clients.
- Parameters:
fl_ctx – FLContext
- Returns:
shareable
- handle_event(event_type, fl_ctx: FLContext)[source]¶
Handles events.
- Parameters:
event_type (str) – event type fired by workflow.
fl_ctx (FLContext) – FLContext information.