Creates a TFF computation that aggregates metrics via sum_then_finalize
.
tff.learning.metrics.sum_then_finalize(
metric_finalizers: Union[tff.learning.metrics.MetricFinalizersType
, tff.learning.metrics.FunctionalMetricFinalizersType
],
local_unfinalized_metrics_type: tff.types.StructWithPythonType
) -> tff.Computation
The returned federated TFF computation has the following type signature:
local_unfinalized_metrics@CLIENTS -> aggregated_metrics@SERVER
, where the
input is given by
tff.learning.models.VariableModel.report_local_unfinalized_metrics()
at
CLIENTS
, and the output is computed by first summing the unfinalized metrics
from CLIENTS
, followed by applying the finalizers at SERVER
.
Returns |
A federated TFF computation that sums the unfinalized metrics from
CLIENTS , and applies the correponding finalizers at SERVER .
|
Raises |
TypeError
|
If the inputs are of the wrong types.
|
ValueError
|
If the keys (i.e., metric names) in metric_finalizers are not
the same as those expected by local_unfinalized_metrics_type .
|