Module: tff.learning.metrics
Stay organized with collections
Save and categorize content based on your preferences.
Libraries for working with metrics in federated learning algorithms.
Classes
class FinalizeThenSampleFactory
: Aggregation Factory that finalizes and then samples the metrics.
class MetricsAggregatorType
: Base class for protocol 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.
finalize_then_sample(...)
: Creates a TFF computation to aggregate metrics via finalize_then_sample
.
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
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-20 UTC.
[null,null,["Last updated 2024-09-20 UTC."],[],[],null,["# Module: tff.learning.metrics\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/federated/blob/v0.87.0 Version 2.0, January 2004 Licensed under the Apache License, Version 2.0 (the) |\n\nLibraries for working with metrics in federated learning algorithms.\n\nClasses\n-------\n\n[`class FinalizeThenSampleFactory`](../../tff/learning/metrics/FinalizeThenSampleFactory): Aggregation Factory that finalizes and then samples the metrics.\n\n[`class MetricsAggregatorType`](../../tff/learning/metrics/MetricsAggregatorType): Base class for protocol classes.\n\n[`class NumBatchesCounter`](../../tff/learning/metrics/NumBatchesCounter): A [`tf.keras.metrics.Metric`](https://www.tensorflow.org/api_docs/python/tf/keras/Metric) that counts the number of batches seen.\n\n[`class NumExamplesCounter`](../../tff/learning/metrics/NumExamplesCounter): A [`tf.keras.metrics.Metric`](https://www.tensorflow.org/api_docs/python/tf/keras/Metric) that counts the number of examples seen.\n\n[`class SecureSumFactory`](../../tff/learning/metrics/SecureSumFactory): Aggregation Factory that performs secure summation over metrics.\n\n[`class SumThenFinalizeFactory`](../../tff/learning/metrics/SumThenFinalizeFactory): Aggregation Factory that sums and then finalizes the metrics.\n\nFunctions\n---------\n\n[`create_default_secure_sum_quantization_ranges(...)`](../../tff/learning/metrics/create_default_secure_sum_quantization_ranges): Create a nested structure of quantization ranges for secure sum encoding.\n\n[`create_functional_metric_fns(...)`](../../tff/learning/metrics/create_functional_metric_fns): Turn a Keras metric construction method into a tuple of pure functions.\n\n[`create_keras_metric_finalizer(...)`](../../tff/learning/metrics/create_keras_metric_finalizer): Creates a finalizer function for the given Keras metric.\n\n[`finalize_then_sample(...)`](../../tff/learning/metrics/finalize_then_sample): Creates a TFF computation to aggregate metrics via `finalize_then_sample`.\n\n[`secure_sum_then_finalize(...)`](../../tff/learning/metrics/secure_sum_then_finalize): Creates a TFF computation that aggregates metrics using secure summation.\n\n[`sum_then_finalize(...)`](../../tff/learning/metrics/sum_then_finalize): Creates a TFF computation that aggregates metrics via `sum_then_finalize`.\n\nType Aliases\n------------\n\n[`FunctionalMetricFinalizersType`](../../tff/learning/metrics/FunctionalMetricFinalizersType)\n\n[`MetricFinalizersType`](../../tff/learning/metrics/MetricFinalizersType)"]]