nvflare.apis.utils.analytix_utils module

create_analytic_dxo(tag: str, value, data_type: AnalyticsDataType, writer: LogWriterName = LogWriterName.TORCH_TB, **kwargs) DXO[source]

Creates the analytic DXO.

Parameters:
  • tag (str) – the tag associated with this value.

  • value – the analytic data.

  • data_type – (AnalyticsDataType): analytic data type.

  • writer (LogWriterName) – syntax of the sender: such as TensorBoard or MLflow

  • kwargs – additional arguments to be passed into the receiver side’s function.

Returns:

A DXO object that contains the analytic data.

send_analytic_dxo(comp: FLComponent, dxo: DXO, fl_ctx: FLContext, event_type: str = 'analytix_log_stats', fire_fed_event: bool = False)[source]

Sends analytic dxo.

Sends analytic dxo by firing an event (of type “analytix_log_stats” by default unless otherwise specified) with the dxo in the fl_ctx.

Parameters:
  • comp (FLComponent) – An FLComponent.

  • dxo (DXO) – analytic data in dxo.

  • fl_ctx (FLContext) – fl context info.

  • event_type (str) – Event type.