class_docstr: Tests for LBFGS optimization algorithm.
class_docstr_tok: ["Tests","for","LBFGS","optimization","algorithm","."]
docstr: Can minimize a two dimensional quadratic function.
docstr_tok: ["Can","minimize","a","two","dimensional","quadratic","function","."]
code: def test_quadratic_bowl_3d_absolute_tolerance(self):
      """Can minimize a two dimensional quadratic function."""
      minimum = np.array([1.0, 1.0, 1.0])
      scales = np.array([2.0, 3.0, 4.0])
  
      @_make_val_and_grad_fn
      def quadratic(x):
          return tf.reduce_sum(
              scales * tf.math.squared_difference(x, minimum)
          )
  
      start = tf.constant([0.1, 0.8, 0.9])
      results_with_tolerance = self.evaluate(
          lbfgs.minimize(
              quadratic,
              initial_position=start,
              max_iterations=50,
              f_absolute_tolerance=1.0,
          )
      )
      self.assertTrue(results_with_tolerance.converged)
  
      results_without_tolerance = self.evaluate(
          lbfgs.minimize(
              quadratic, initial_position=start, max_iterations=50
          )
      )
      self.assertTrue(results_without_tolerance.converged)
      self.assertLess(
          results_with_tolerance.num_iterations,
          results_without_tolerance.num_iterations,
      )
  
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_utils
  from tensorflow_probability.python.optimizer import lbfgs
label_desc: Use image node_id 2 for calling the LBfgsTest obj's underlying member method code with example usage: obj.test_quadratic_bowl_3d_absolute_tolerance() and returns: tf