nvflare.app_opt.he.model_serialize_filter module

class HEModelSerializeFilter(tenseal_context_file='server_context.tenseal')[source]

Bases: PersistorFilter

Used to serialize TenSEAL encrypted server models for use with homomorphic encryption (HE) support using TenSEAL https://github.com/OpenMined/TenSEAL.

Parameters:

tenseal_context_file – tenseal context files containing TenSEAL context

handle_event(event_type: str, fl_ctx: FLContext)[source]

Handles events.

Parameters:
  • event_type (str) – event type fired by workflow.

  • fl_ctx (FLContext) – FLContext information.

process_post_get(learnable: Learnable, fl_ctx: FLContext) Learnable[source]

Filter process applied to the Learnable object after it was returned.

Parameters:
  • learnable – Learnable

  • fl_ctx – FLContext

Returns:

a Learnable object

process_post_load(learnable: Learnable, fl_ctx: FLContext) Learnable[source]

Filter process applied to the Learnable object after it was loaded.

Parameters:
  • learnable – Learnable

  • fl_ctx – FLContext

Returns:

a Learnable object

process_post_save(learnable: Learnable, fl_ctx: FLContext) Learnable[source]

Filter process applied to the Learnable object to support persisting when containing encrypted objects.

Parameters:
  • learnable – Learnable

  • fl_ctx – FLContext

Returns:

a Learnable object

process_pre_save(learnable: Learnable, fl_ctx: FLContext) Learnable[source]

Filter process applied to the Learnable object to support persisting when containing encrypted objects.

Parameters:
  • learnable – Learnable

  • fl_ctx – FLContext

Returns:

a Learnable object