docstr: Tests example/user epsilons consistent with Vadhan (2017) Lemma 2.2.
docstr_tok: ["Tests","example\/user","epsilons","consistent","with","Vadhan","(","2017",")","Lemma","2.2","."]
code: def test_user_privacy_epsilon_delta_consistency(
      self, noise_multiplier, max_examples_per_user
  ):
      """Tests example/user epsilons consistent with Vadhan (2017) Lemma 2.2."""
      num_epochs = 5
      example_delta = 1e-8
      q = 2e-4
      example_eps = _example_privacy(
          num_epochs,
          noise_multiplier=noise_multiplier,
          example_delta=example_delta,
          poisson_subsampling_probability=q,
          accountant_type=_RDP,
      )
  
      user_delta = math.exp(
          math.log(example_delta)
          + compute_dp_sgd_privacy_lib._logexpm1(
              max_examples_per_user * example_eps
          )
          - compute_dp_sgd_privacy_lib._logexpm1(example_eps)
      )
      user_eps = _user_privacy(
          num_epochs,
          noise_multiplier=noise_multiplier,
          user_delta=user_delta,
          max_examples_per_user=max_examples_per_user,
          poisson_subsampling_probability=q,
          accountant_type=_RDP,
      )
      self.assertAlmostEqual(
          user_eps, example_eps * max_examples_per_user
      )
  
file_path: privacy/tensorflow_privacy/privacy/analysis/compute_dp_sgd_privacy_test.py
imports: import math
  from absl.testing import absltest
  from absl.testing import parameterized
  from tensorflow_privacy.privacy.analysis import compute_dp_sgd_privacy_lib
label_desc: Use image node_id 6 for calling the ComputeDpSgdPrivacyTest obj's underlying member method code with example usage: obj.test_user_privacy_epsilon_delta_consistency(noise_multiplier, max_examples_per_user) without return types