code: def test_fit_posterior_with_joint_q(self):
      # Target distribution: equiv to MVNFullCovariance(cov=[[1., 1.], [1., 2.]])
      def p_log_prob(z, x):
          return normal.Normal(0.0, 1.0).log_prob(z) + normal.Normal(
              z, 1.0
          ).log_prob(x)
  
      # The Q family is a joint distribution that can express any 2D MVN.
      b = tf.Variable([0.0, 0.0])
      l = deferred_tensor.TransformedVariable(
          tf.eye(2), fill_scale_tril.FillScaleTriL()
      )
  
      def trainable_q_fn():
          z = yield jdc.JointDistributionCoroutine.Root(
              normal.Normal(b[0], l[0, 0], name="z")
          )
          _ = yield normal.Normal(b[1] + l[1, 0] * z, l[1, 1], name="x")
  
      q = jdc.JointDistributionCoroutine(trainable_q_fn)
  
      seed = test_util.test_seed()
      loss_curve = optimization.fit_surrogate_posterior(
          p_log_prob,
          q,
          num_steps=1000,
          sample_size=100,
          optimizer=tf_keras.optimizers.Adam(learning_rate=0.1),
          seed=seed,
      )
      self.evaluate(tf1.global_variables_initializer())
      loss_curve_ = self.evaluate((loss_curve))
  
      # Since the Q family includes the true distribution, the optimized
      # loss should be (approximately) zero.
      self.assertAllClose(loss_curve_[-1], 0.0, atol=0.1)
  
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import fill_scale_tril
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import deterministic
  from tensorflow_probability.python.distributions import gaussian_process
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import joint_distribution_auto_batched
  from tensorflow_probability.python.distributions import joint_distribution_coroutine
  from tensorflow_probability.python.distributions import lognormal
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import poisson
  from tensorflow_probability.python.experimental.util import trainable
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.internal import tf_keras
  from tensorflow_probability.python.math.psd_kernels import exponentiated_quadratic
  from tensorflow_probability.python.util import deferred_tensor
  from tensorflow_probability.python.vi import optimization
label_desc: Use image node_id 3 for calling the OptimizationTests obj's underlying member method code with example usage: obj.test_fit_posterior_with_joint_q() and returns: unknown