I want to add noise to the gradient on the client side. I modified tf.keras.optimizers.Adam() to DPKerasAdamOptimizer(), but it doesn't work.
iterative_process = tff.learning.build_federated_averaging_process(
model_fn=Create_tff_model,
client_optimizer_fn=lambda: DPKerasAdamOptimizer(1,1.85))
The error is
AssertionError: Neither _compute_gradients() or get_gradients() on the differentially private optimizer was called. This means the training is not differentially private. It may be the case that you need to upgrade to TF 2.4 or higher to use this particular optimizer.
I can add noise on the server side using the tff.learning.model_update_aggregator.dp_aggregator(noise_multiplier, client_per_round), but how to add noise on the client side?