nvflare.app_common.np.np_model_persistor module

class NPModelPersistor(model_dir='models', model_name='server.npy')[source]

Bases: ModelPersistor

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.

load_model(fl_ctx: FLContext) Learnable[source]

Initialize and load the model.

Parameters

fl_ctx – FLContext

Returns

Model object

save_model(model_learnable: Learnable, fl_ctx: FLContext)[source]

Persist the model object.

Parameters
  • model – Model object to be saved

  • fl_ctx – FLContext