<p>You can get a basic recommended setup by using <a href="https://www.tensorflow.org/federated/api_docs/python/tff/learning/dp_aggregator" rel="nofollow noreferrer"><code>tff.learning.dp_aggregator</code></a>, and use it as</p>
<pre><code>iterative_process = tff.learning.build_federated_averaging_process(
    ...,
    model_update_aggregation_factory=tff.learning.dp_aggregator(...))
</code></pre>
<p>For guidance of how to use it with in learning algorithms in general, see tutorial: <a href="https://www.tensorflow.org/federated/tutorials/tuning_recommended_aggregators" rel="nofollow noreferrer">Tuning recommended aggregations for learning</a>.</p>
<p>The default clipping method used corresponds to &quot;flat clipping&quot;, as termed in the paper you link to. However, the clipping norm is not fixed, but automatically adapted based on values seen in previous rounds of training. For details, see documentation and the paper <a href="https://arxiv.org/abs/1905.03871" rel="nofollow noreferrer">Differentially Private Learning with Adaptive Clipping</a>.</p>
<p>If you want to use a fixed clipping norm <code>my_clip_norm</code>, you can look at the implementation and see what components can be modified. I believe you should be able to simply use:</p>
<p><code>tff.aggregators.DifferentiallyPrivateFactory.gaussian_fixed(..., clip=my_clip_norm)</code></p>
<p>If you wanted to use some form of per-layer clipping, you would need to write your own aggregator. Implementation of <code>tff.aggregators.DifferentiallyPrivateFactory</code> could be a good start, and see also tutorial <a href="https://www.tensorflow.org/federated/tutorials/custom_aggregators" rel="nofollow noreferrer">Implementing Custom Aggregations</a>.</p>
Norm clipping technique in TFF
<p>I'm training a DP federated learning model using the &quot;DP-FedAvg&quot; algorithm, which is based on below paper:</p>
<p><a href="https://arxiv.org/abs/1710.06963" rel="nofollow noreferrer">Learning Differentially Private Recurrent Language Models</a></p>
<p>The paper proposes two norm clipping techniques &quot;flat clipping&quot; and &quot;per-layer clipping&quot;, then performs the experiments using &quot;per-layer clipping&quot;.</p>
<p>In case of TFF, when attaching a DP-query and an aggregation process to the federated model, which clipping technique is implemented by default? Is there a way to specify the clipping technique used?</p>