forked from 626_privacy/tensorflow_privacy
update keras model
This commit is contained in:
parent
6982e027b5
commit
13b3a04a3e
1 changed files with 1 additions and 1 deletions
|
@ -27,7 +27,7 @@ def make_dp_model_class(cls):
|
||||||
noise = tf.random.normal(
|
noise = tf.random.normal(
|
||||||
tf.shape(input=summed_grads), stddev=noise_stddev)
|
tf.shape(input=summed_grads), stddev=noise_stddev)
|
||||||
noised_grads = summed_grads + noise
|
noised_grads = summed_grads + noise
|
||||||
return noised_grads / tf.cast(stacked_grads.shape[0], tf.float32)
|
return noised_grads / tf.cast(stacked_grads.shape[0], noised_grads.dtype)
|
||||||
|
|
||||||
def compute_per_example_grads(self, data):
|
def compute_per_example_grads(self, data):
|
||||||
x, y = data
|
x, y = data
|
||||||
|
|
Loading…
Reference in a new issue