Help protect the Great Barrier Reef with TensorFlow on Kaggle Join Challenge

tff.learning.metrics.sum_then_finalize

Creates a TFF computation that aggregates metrics via sum_then_finalize.

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.Model.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.

metric_finalizers An OrderedDict of string metric names to finalizer functions returned by tff.learning.Model.metric_finalizers(). It should have the same keys (i.e., metric names) as the OrderedDict returned by tff.learning.Model.report_local_unfinalized_metrics(). A finalizer is a callable (typically tf.function or tff.tf_computation decoreated function) that takes in a metric's unfinalized values, and returns the finalized values.
local_unfinalized_metrics_type A tff.types.StructWithPythonType (with OrderedDict as the Python container) of a client's local unfinalized metrics. Let local_unfinalized_metrics be the output of tff.learning.Model.report_local_unfinalized_metrics(). Its type can be obtained by tff.framework.type_from_tensors(local_unfinalized_metrics).

A federated TFF computation that sums the unfinalized metrics from CLIENTS, and applies the correponding finalizers at SERVER.

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.