nvflare.app_common.abstract.aggregator module

class Aggregator[source]

Bases: FLComponent, 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.

abstract 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.

abstract aggregate(fl_ctx: FLContext) Shareable[source]

Perform the aggregation for all the received Shareable from the clients.

Parameters:

fl_ctx – FLContext

Returns:

shareable

reset(fl_ctx: FLContext)[source]

Reset the internal state of the aggregator.

Parameters:

fl_ctx – FLContext

Returns: