class_docstr: Tests for BFGS optimization algorithm.
class_docstr_tok: ["Tests","for","BFGS","optimization","algorithm","."]
docstr: Can minimize a strongly skewed quadratic function.
docstr_tok: ["Can","minimize","a","strongly","skewed","quadratic","function","."]
code: def test_quadratic_with_strong_skew(self):
      """Can minimize a strongly skewed quadratic function."""
      np.random.seed(89793)
      minimum = np.random.randn(3)
      principal_values = np.diag(np.array([0.1, 2.0, 50.0]))
      rotation = special_ortho_group.rvs(3)
      hessian = np.dot(
          np.transpose(rotation), np.dot(principal_values, rotation)
      )
  
      @_make_val_and_grad_fn
      def quadratic(x):
          y = x - minimum
          yp = tf.tensordot(hessian, y, axes=[1, 0])
          return tf.reduce_sum(y * yp) / 2
  
      start = tf.ones_like(minimum)
      results = self.evaluate(
          bfgs.minimize(
              quadratic, initial_position=start, tolerance=1e-8
          )
      )
      self.assertTrue(results.converged)
      final_gradient = results.objective_gradient
      final_gradient_norm = _norm(final_gradient)
      print(final_gradient_norm)
      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 9 for calling the BfgsTest obj's underlying member method code with example usage: obj.test_quadratic_with_strong_skew() and returns: unknown