Expose noise_multiplier and l2_norm_clip as public read-only attributes.

PiperOrigin-RevId: 642298339
This commit is contained in:
William Kong 2024-06-11 09:38:13 -07:00 committed by A. Unique TensorFlower
parent 99c25e3be5
commit 00384db109

View file

@ -157,6 +157,14 @@ def make_dp_model_class(cls):
self.train_step, experimental_compile=True
)
@property
def noise_multiplier(self):
return self._noise_multiplier
@property
def l2_norm_clip(self):
return self._l2_norm_clip
def _process_per_example_grads(self, grads):
grads_flat = tf.nest.flatten(grads)
squared_l2_norms = [