flip.nvflare.metrics
Functions
|
Sends a metric value to the Central Hub. |
|
Use on the server to handle metrics data events raised by clients. |
Module Contents
- flip.nvflare.metrics.send_metrics_value(label: str, value: float, fl_ctx: nvflare.apis.fl_context.FLContext, round: int | None = None, flip: flip.FLIP = FLIP()) None[source]
Sends a metric value to the Central Hub.
If ‘round’ is provided, it will be included in the event data sent to the Central Hub. This allows the client to specify the x-value for the metric, which can be different from the global round number. If ‘round’ is not provided, the Central Hub will use the global round number as the x-value for the metric.
- Parameters:
label – The label of the metric.
value – The value of the metric.
fl_ctx – The federated learning context.
round – The round number (default: None).
- flip.nvflare.metrics.handle_metrics_event(event_data: nvflare.apis.shareable.Shareable, global_round: int, model_id: str, flip: flip.FLIP = FLIP()) None[source]
Use on the server to handle metrics data events raised by clients.
- Parameters:
event_data – The event data containing the metrics.
global_round – The global round number (aka _current_round in scatter_and_gather scripts).
model_id – The ID of the model.