nvflare.app_common.abstract.shareable_generator module

class ShareableGenerator[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 learnable_to_shareable(model: Learnable, fl_ctx: FLContext) Shareable[source]

Generate the initial Shareable from the Learnable object.

Parameters:
  • model – model object

  • fl_ctx – FLContext

Returns:

shareable

abstract shareable_to_learnable(shareable: Shareable, fl_ctx: FLContext) Learnable[source]

Construct the Learnable object from Shareable.

Parameters:
  • shareable – shareable

  • fl_ctx – FLContext

Returns:

model object