code: def _fit_sparse_exact_hessian(  # pylint: disable = missing-docstring
      model_matrix,
      response,
      model,
      model_coefficients_start,
      tolerance,
      l1_regularizer,
      l2_regularizer=None,
      maximum_iterations=1,
      maximum_full_sweeps_per_iteration=1,
      learning_rate=None,
      name=None,
  ):
      with tf.name_scope(name or "fit_sparse_exact_hessian"):
          # TODO(b/111922388): Include dispersion and offset parameters.
          def _neg_log_likelihood(x):
              predicted_linear_response = (
                  fisher_scoring.compute_predicted_linear_response(
                      model_matrix, x
                  )
              )
              log_probs = model.log_prob(
                  response, predicted_linear_response
              )
              return -log_probs
  
          def _grad_and_hessian_loss_fn(x):
              loss = _neg_log_likelihood(x)
              grad_loss = tf.gradients(ys=loss, xs=[x])[0]
              hessian_loss = tf.hessians(ys=loss, xs=[x])[0]
              hessian_chol = tf.linalg.cholesky(hessian_loss)
              return grad_loss, hessian_chol, tf.ones_like(grad_loss)
  
          return proximal_hessian_sparse.minimize(
              _grad_and_hessian_loss_fn,
              x_start=model_coefficients_start,
              l1_regularizer=l1_regularizer,
              l2_regularizer=l2_regularizer,
              maximum_iterations=maximum_iterations,
              maximum_full_sweeps_per_iteration=maximum_full_sweeps_per_iteration,
              learning_rate=learning_rate,
              tolerance=tolerance,
              name=name,
          )
  
file_path: probability/tensorflow_probability/python/glm/proximal_hessian.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.glm import fisher_scoring
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.math.linalg import sparse_or_dense_matvecmul
  from tensorflow_probability.python.optimizer import proximal_hessian_sparse
label_desc: Use image node_id 4 for calling a global function with example usage: _fit_sparse_exact_hessian(model_matrix, response, model, model_coefficients_start, tolerance, l1_regularizer, l2_regularizer, maximum_iterations, maximum_full_sweeps_per_iteration, learning_rate, name) and returns: proximal_hessian_sparse, unknown, grad_loss,  hessian_chol,  tf