nvflare.edge.assessor module

class Assessment(value)[source]

Bases: Enum

An enumeration.

CONTINUE = 'continue'
TASK_DONE = 'task_done'
WORKFLOW_DONE = 'workflow_done'
class Assessor[source]

Bases: FLComponent, ABC

Assessor is a component used by SAGE (ScatterAndGatherForEdge) workflow controller to assess the quality of the current task, and decides whether to continue the execution of the current task.

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.

abstract 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

finalize(fl_ctx: FLContext)[source]

Called at the end of the SAGE workflow to finalize the assessor.

Parameters:

fl_ctx – FLContext object

Returns: None

abstract process_child_update(update: ~nvflare.apis.shareable.Shareable, fl_ctx: ~nvflare.apis.fl_context.FLContext) -> (<class 'bool'>, typing.Optional[nvflare.apis.shareable.Shareable])[source]
abstract 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