code: def setUp(self):
      super(MutualInformationTest, self).setUp()
      self.seed = tfp_test_util.test_seed()
  
      self.scores = tfp_test_util.test_np_rng().normal(
          loc=1.0, scale=2.0, size=[13, 17]
      )
  
      batch_size = 1000
      rho = 0.8
      dim = 2
      x, eps = tf.split(
          value=tf.random.normal(
              shape=(2 * batch_size, dim), seed=self.seed
          ),
          num_or_size_splits=2,
          axis=0,
      )
      mean = rho * x
      stddev = tf.sqrt(1.0 - tf.square(rho))
      y = mean + stddev * eps
      conditional_dist = mvn_diag.MultivariateNormalDiag(
          mean, scale_diag=stddev * tf.ones((batch_size, dim))
      )
      marginal_dist = mvn_diag.MultivariateNormalDiag(
          tf.zeros(dim), tf.ones(dim)
      )
  
      # The conditional_scores has its shape [y_batch_dim, distibution_batch_dim]
      # as the `lower_bound_info_nce` requires `scores[i, j] = f(x[i], y[j])
      # = log p(x[i] | y[j])`.
      self.conditional_scores = conditional_dist.log_prob(
          y[:, tf.newaxis, :]
      )
      self.marginal_scores = marginal_dist.log_prob(y)[:, tf.newaxis]
      self.optimal_critic = (
          1 + self.conditional_scores - self.marginal_scores
      )
      self.theoretical_mi = np.float32(
          -0.5 * np.log(1.0 - rho**2) * dim
      )
      # Y is N-D standard normal distributed.
      self.differential_entropy_y = 0.5 * np.log(2 * np.pi * np.e) * dim
  
file_path: probability/tensorflow_probability/python/vi/mutual_information_test.py
imports: import numpy
  import scipy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.vi import mutual_information
label_desc: Use image node_id 1 for calling the MutualInformationTest obj's underlying member method code with example usage: obj.setUp() without return types