AggregationProcessFactory for tensorflow_privacy DPQueries.

Inherits From: AggregationProcessFactory

The created tff.templates.AggregationProcess aggregates values placed at CLIENTS according to the provided DPQuery, and outputs the result placed at SERVER.

A DPQuery defines preprocessing to perform on each value, and postprocessing to perform on the aggregated, preprocessed values. Provided the preprocessed values ("records") are aggregated in a way that is consistent with the DPQuery, formal (epsilon, delta) privacy guarantees can be derived. This aggregation is controlled by record_aggregation_factory.

A simple summation (using the default tff.templates.SumFactory) is usually acceptable. Aggregations that change the records (such as compression or secure aggregation) may be allowed so long as they do not increase the sensitivity of the query. It is the users' responsibility to ensure that the mode of aggregation is consistent with the DPQuery. Note that the DPQuery's built-in aggregation functions (accumulate_preprocessed_record and merge_sample_states) are ignored in favor of the provided aggregator.

To obtain concrete (epsilon, delta) guarantees, one could use the analysis tools provided in tensorflow_privacy by using QueryWithLedger.

query A tfp.SumAggregationDPQuery to perform private estimation.
record_aggregation_factory A tff.aggregators.AggregationProcessFactory to aggregate values after preprocessing by the query. If None, defaults to tff.aggregators.SumFactory. The provided factory is assumed to implement a sum, and to have the property that it does not increase the sensitivity of the query-- typically this means that it should not increase the l2 norm of the records when aggregating.

TypeError If query is not an instance of tfp.SumAggregationDPQuery or record_aggregation_factory is not an instance of tff.aggregators.AggregationProcessFactory.



View source

Creates a tff.aggregators.AggregationProcess aggregating value_type.

The provided value_type is a non-federated tff.Type object, that is, value_type.is_federated() should return False. Provided value_type must be a tff.TensorType or a tff.StructType.

The returned tff.aggregators.AggregationProcess will be created for aggregating values matching value_type. That is, its next method will expect type <S@SERVER, {value_type}@CLIENTS>, where S is the unplaced return type of its initialize method.

value_type A tff.Type without placement.

A tff.templates.AggregationProcess.