10335f61775faabe5e931f30b0ecf91f0719b727,tutorials/mnist_dpsgd_tutorial.py,,main,#Any#,180

Before Change




def main(unused_argv):
  tf.logging.set_verbosity(tf.logging.INFO)
  if FLAGS.dpsgd and FLAGS.batch_size % FLAGS.microbatches != 0:
    raise ValueError("Number of microbatches should divide evenly batch_size")

  // Load training and test data.

After Change



    // Compute the privacy budget expended.
    if FLAGS.dpsgd:
      if FLAGS.noise_multiplier > 0.0:
        eps, _ = compute_dp_sgd_privacy_lib.compute_dp_sgd_privacy(
            60000, FLAGS.batch_size, FLAGS.noise_multiplier, epoch, 1e-5)
        print("For delta=1e-5, the current epsilon is: %.2f" % eps)
      else:
        print("Trained with DP-SGD but with zero noise.")
    else:
      print("Trained with vanilla non-private SGD optimizer")

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: tensorflow/privacy
Commit Name: 10335f61775faabe5e931f30b0ecf91f0719b727
Time: 2020-05-07
Author: schien@google.com
File Name: tutorials/mnist_dpsgd_tutorial.py
Class Name:
Method Name: main


Project Name: GoogleCloudPlatform/cloudml-samples
Commit Name: 867832752380c89a47d6a7a9df44ca4dae862a5d
Time: 2017-04-27
Author: puneith@google.com
File Name: census/estimator/trainer/model.py
Class Name:
Method Name:


Project Name: tensorflow/models
Commit Name: f56363ef894852d584ffd9bee4b3ea4a5fd99976
Time: 2018-03-14
Author: karmel@arcaio.com
File Name: official/utils/logging/hooks_helper_test.py
Class Name:
Method Name:


Project Name: tensorflow/tpu
Commit Name: 6769bcc7e5f1c879f69e7570125c034c4cea680f
Time: 2020-07-08
Author: allencwang@google.com
File Name: tools/datasets/imagenet_to_gcs.py
Class Name:
Method Name: main