Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings


View source on GitHub

Makes a DPQuery to estimate vector averages with differential privacy.

    clip, noise_multiplier, expected_total_weight, adaptive_clip_learning_rate=0,
    target_unclipped_quantile=None, clipped_count_budget_allocation=None,
    expected_num_clients=None, per_vector_clipping=False, model=None

Supports many of the types of query available in tensorflow_privacy, including nested ("per-vector") queries as described in https://arxiv.org/pdf/1812.06210.pdf, and quantile-based adaptive clipping as described in https://arxiv.org/abs/1905.03871.


  • clip: The query's L2 norm bound.
  • noise_multiplier: The ratio of the (effective) noise stddev to the clip.
  • expected_total_weight: The expected total weight of all clients, used as the denominator for the average computation.
  • adaptive_clip_learning_rate: Learning rate for quantile-based adaptive clipping. If 0, fixed clipping is used. If per-vector clipping is enabled, the learning rate of each vector is proportional to that vector's initial clip.
  • target_unclipped_quantile: Target unclipped quantile for adaptive clipping.
  • clipped_count_budget_allocation: The fraction of privacy budget to use for estimating clipped counts.
  • expected_num_clients: The expected number of clients for estimating clipped fractions.
  • per_vector_clipping: If True, clip each weight tensor independently. Otherwise, global clipping is used. The clipping norm for each vector (or the initial clipping norm, in the case of adaptive clipping) is proportional to the sqrt of the vector dimensionality such that the root sum squared of the individual clips equals clip.
  • model: A tff.learning.Model to determine the structure of model weights. Required only if per_vector_clipping is True.


A DPQuery suitable for use in a call to build_dp_aggregate to perform Federated Averaging with differential privacy.