class_docstr: Tests for BFGS optimization algorithm.
class_docstr_tok: ["Tests","for","BFGS","optimization","algorithm","."]
docstr: Checks that specifying the 'initial_inverse_hessian_estimate' works.
docstr_tok: ["Checks","that","specifying","the","'initial_inverse_hessian_estimate","'","works","."]
code: def test_inverse_hessian_spec(self):
      """Checks that specifying the 'initial_inverse_hessian_estimate' works."""
      minimum = np.array([1.0, 1.0], dtype=np.float32)
      scales = np.array([2.0, 3.0], dtype=np.float32)
  
      @_make_val_and_grad_fn
      def quadratic(x):
          return tf.reduce_sum(
              scales * tf.math.squared_difference(x, minimum)
          )
  
      start = tf.constant([0.6, 0.8])
      test_inv_hessian = tf.constant(
          [[2.0, 1.0], [1.0, 2.0]], dtype=np.float32
      )
      results = self.evaluate(
          bfgs.minimize(
              quadratic,
              initial_position=start,
              tolerance=1e-8,
              initial_inverse_hessian_estimate=test_inv_hessian,
          )
      )
      self.assertTrue(results.converged)
      final_gradient = results.objective_gradient
      final_gradient_norm = _norm(final_gradient)
      self.assertLessEqual(final_gradient_norm, 1e-8)
      self.assertArrayNear(results.position, minimum, 1e-5)
  
imports: from absl.testing import parameterized
  import numpy
  from scipy.stats import special_ortho_group
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.optimizer import bfgs
  from tensorflow_probability.python.optimizer import bfgs_utils
label_desc: Use image node_id 3 for calling the BfgsTest obj's underlying member method code with example usage: obj.test_inverse_hessian_spec() and returns: tf