update keras model

This commit is contained in:
pranav subramani 2021-01-08 00:23:32 -07:00
parent 6982e027b5
commit 13b3a04a3e

View file

@ -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