code: def testTwoSweepsAreBetterThanOne(self):
      # Compare the log-likelihood after one sweep of fit_sparse to the
      # log-likelihood after two sweeps.  Expect greater log-likelihood after two
      # sweeps.  (This should be true typically but is not guaranteed to be true
      # in every case.)
      x_, y_, _, _ = self._make_dataset(n=int(1e5), d=100, link="logit")
  
      model = family.BernoulliNormalCDF()
      model_coefficients_0 = tf.zeros(x_.shape[-1], self.dtype)
  
      x_ = self._adjust_dtype_and_shape_hints(x_)
      y_ = self._adjust_dtype_and_shape_hints(y_)
  
      (
          model_coefficients_1,
          is_converged,
          _,
      ) = proximal_hessian.fit_sparse_one_step(
          model_matrix=x_,
          response=y_,
          model=model,
          model_coefficients_start=model_coefficients_0,
          l1_regularizer=800.0,
          l2_regularizer=None,
          maximum_full_sweeps=1,
          tolerance=1e-6,
          learning_rate=None,
      )
      model_coefficients_1_ = self.evaluate(model_coefficients_1)
  
      self.assertAllEqual(False, is_converged)
  
      model_coefficients_2, _, _ = proximal_hessian.fit_sparse_one_step(
          model_matrix=x_,
          response=y_,
          model=model,
          model_coefficients_start=tf.convert_to_tensor(
              value=model_coefficients_1_
          ),
          l1_regularizer=800.0,
          l2_regularizer=None,
          maximum_full_sweeps=1,
          tolerance=1e-6,
          learning_rate=None,
      )
      model_coefficients_2_ = self.evaluate(model_coefficients_2)
  
      def _joint_log_prob(model_coefficients_):
          predicted_linear_response_ = tf.linalg.matvec(
              x_, model_coefficients_
          )
          return tf.reduce_sum(
              model.log_prob(y_, predicted_linear_response_)
          )
  
      self.assertAllGreater(
          _joint_log_prob(model_coefficients_2_)
          - _joint_log_prob(model_coefficients_1_),
          0,
      )
  
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import bernoulli
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import uniform
  from tensorflow_probability.python.glm import family
  from tensorflow_probability.python.glm import proximal_hessian
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import sparse
label_desc: Use image node_id 5 for calling the _ProximalHessianTest obj's underlying member method code with example usage: obj.testTwoSweepsAreBetterThanOne() and returns: tf