nvflare.edge.assessors.sgap module

class SGAPAssessor(shareable_generator_id: str, aggregator_id: str, persistor_id: str)[source]

Bases: Assessor

This assessor implements its required logic by using a Shareable Generator, an Aggregator, and a Persistor (SGAP).

Parameters:
  • shareable_generator_id – component ID of the Shareable Generator. If empty, the PassthroughShareableGenerator will be used.

  • aggregator_id – component ID of the Aggregator.

  • persistor_id – component ID of the Persistor. If not specified, the Persistor will load initial model and save the final model.

assess(fl_ctx: FLContext) Assessment[source]

This is called by SAGE to assess the situation of the current task, and decides whether the task should continue to run.

Note: the fl_ctx contains task info that could be used to make assessment.

Parameters:

fl_ctx – FLContext object

Returns: an Assessment value.

do_assessment(fl_ctx: FLContext)[source]
end_task(fl_ctx: FLContext)[source]

This is called by SAGE at the end of a task.

Parameters:

fl_ctx – FLContext object

Returns: None

process_child_update(data: ~nvflare.apis.shareable.Shareable, fl_ctx: ~nvflare.apis.fl_context.FLContext) -> (<class 'bool'>, typing.Optional[nvflare.apis.shareable.Shareable])[source]
start_task(fl_ctx: FLContext) Shareable[source]

This is called by SAGE at the start of a task.

Parameters:

fl_ctx – FLContext object

Returns: task data to be sent to clients