nvflare.edge.assessors.model_update module¶
- class ModelUpdateAssessor(persistor_id, model_manager_id, device_manager_id, max_model_version, device_wait_timeout: float | None = None, device_status_log_interval: float | None = 30.0)[source]¶
Bases:
AssessorInitialize the ModelUpdateAssessor. Enable both asynchronous and synchronous model updates from clients. For asynchronous updates, the staleness is calculated based on the starting and current model version. And the aggregation scheme and weights are calculated following FedBuff paper “Federated Learning with Buffered Asynchronous Aggregation”.
- Parameters:
persistor_id (str) – ID of the persistor component used to load and save models.
model_manager_id (str) – ID of the model manager component.
device_manager_id (str) – ID of the device manager component.
max_model_version (int) – Maximum model version to stop the workflow.
device_wait_timeout (float, optional) – Timeout in seconds for waiting for sufficient devices. None means no timeout. Default is None.
device_status_log_interval (float, optional) – Interval in seconds for logging device status. Default is 30 seconds.
- 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.