nvflare.app_common.executors.splitnn_learner_executor module

class SplitNNLearnerExecutor(learner_id, init_model_task_name='_splitnn_task_init_model_', train_task_name='_splitnn_task_train_')[source]

Bases: Executor

Key component to run learner on clients.

Parameters:
  • learner_id (str) – id pointing to the learner object

  • train_task_name (str, optional) – label to dispatch train task. Defaults to AppConstants.TASK_TRAIN.

  • submit_model_task_name (str, optional) – label to dispatch submit model task. Defaults to AppConstants.TASK_SUBMIT_MODEL.

  • validate_task_name (str, optional) – label to dispatch validation task. Defaults to AppConstants.TASK_VALIDATION.

execute(task_name: str, shareable: Shareable, fl_ctx: FLContext, abort_signal: Signal) Shareable[source]

Executes a task.

Parameters:
  • task_name (str) – task name.

  • shareable (Shareable) – input shareable.

  • fl_ctx (FLContext) – fl context.

  • abort_signal (Signal) – signal to check during execution to determine whether this task is aborted.

Returns:

An output shareable.

finalize(fl_ctx: FLContext)[source]
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.

initialize(fl_ctx: FLContext)[source]