Thanks for tuning in to Google I/O. View all sessions on demandWatch on demand

Module: tff.learning.metrics

Libraries for working with metrics in federated learning algorithms.

Classes

class NumBatchesCounter: A tf.keras.metrics.Metric that counts the number of batches seen.

class NumExamplesCounter: A tf.keras.metrics.Metric that counts the number of examples seen.

class SecureSumFactory: Aggregation Factory that performs secure summation over metrics.

class SumThenFinalizeFactory: Aggregation Factory that sums and then finalizes the metrics.

Functions

create_default_secure_sum_quantization_ranges(...): Create a nested structure of quantization ranges for secure sum encoding.

create_functional_metric_fns(...): Turn a Keras metric construction method into a tuple of pure functions.

create_keras_metric_finalizer(...): Creates a finalizer function for the given Keras metric.

secure_sum_then_finalize(...): Creates a TFF computation that aggregates metrics using secure summation.

sum_then_finalize(...): Creates a TFF computation that aggregates metrics via sum_then_finalize.

Type Aliases

FunctionalMetricFinalizersType

MetricFinalizersType

MetricsAggregatorType