# Module: tff.aggregators

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) 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) |

Libraries for constructing federated aggregation.

For example uses of the symbols in this module, see
[Tuning recommended aggregations for learning](https://www.tensorflow.org/federated/tutorials/tuning_recommended_aggregators)
tutorial, and for details of the design and how to implement new aggregations,
see [Implementing Custom Aggregations](https://www.tensorflow.org/federated/tutorials/custom_aggregators) tutorial.

## Classes

[`class DifferentiallyPrivateFactory`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/DifferentiallyPrivateFactory): `UnweightedAggregationFactory` for tensorflow_privacy DPQueries.

[`class DiscreteFourierTransformFactory`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/DiscreteFourierTransformFactory): `UnweightedAggregationFactory` for discrete Fourier transform.

[`class EncodedSumFactory`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/EncodedSumFactory): `UnweightedAggregationFactory` for encoded sum.

[`class HadamardTransformFactory`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/HadamardTransformFactory): `UnweightedAggregationFactory` for fast Walsh-Hadamard transform.

[`class MeanFactory`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/MeanFactory): Aggregation factory for weighted mean.

[`class PrivateQuantileEstimationProcess`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/PrivateQuantileEstimationProcess): A [`tff.templates.EstimationProcess`](https://www.tensorflow.org/federated/api_docs/python/tff/templates/EstimationProcess) for estimating private quantiles.

[`class SecureModularSumFactory`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/SecureModularSumFactory): `AggregationProcess` factory for securely summing values under a modulus.

[`class SecureSumFactory`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/SecureSumFactory): `AggregationProcess` factory for securely summing values.

[`class SumFactory`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/SumFactory): `UnweightedAggregationFactory` for sum.

[`class UnweightedAggregationFactory`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/UnweightedAggregationFactory): Factory for creating [`tff.templates.AggregationProcess`](https://www.tensorflow.org/federated/api_docs/python/tff/templates/AggregationProcess) without weights.

[`class UnweightedMeanFactory`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/UnweightedMeanFactory): Aggregation factory for unweighted mean.

[`class UnweightedReservoirSamplingFactory`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/UnweightedReservoirSamplingFactory): An `UnweightedAggregationFactory` for reservoir sampling values.

[`class WeightedAggregationFactory`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/WeightedAggregationFactory): Factory for creating [`tff.templates.AggregationProcess`](https://www.tensorflow.org/federated/api_docs/python/tff/templates/AggregationProcess) with weights.

## Functions

[`add_measurements(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/add_measurements): Wraps `AggregationFactory` to report additional measurements.

[`as_weighted_aggregator(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/as_weighted_aggregator): Constructs a weighted wrapper for an unweighted aggregation factory.

[`clipping_factory(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/clipping_factory): Creates an aggregation factory to perform L2 clipping.

[`concat_factory(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/concat_factory): Aggregation factory for concatenation of input to a single tensor.

[`federated_sample(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/federated_sample): Aggregation to produce uniform sample of at most `max_num_samples` values.

[`secure_quantized_sum(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/secure_quantized_sum): Quantizes and sums values securely.

[`zeroing_factory(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/zeroing_factory): Creates an aggregation factory to perform zeroing.

## Type Aliases

[`AggregationFactory`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/AggregationFactory)