nvflare.edge.assessors.sgap module¶
- class SGAPAssessor(shareable_generator_id: str, aggregator_id: str, persistor_id: str)[source]¶
Bases:
AssessorThis 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.
- end_task(fl_ctx: FLContext)[source]¶
This is called by SAGE at the end of a task.
- Parameters:
fl_ctx – FLContext object
Returns: None