class_docstr: Tests for optimization algorithms.
docstr: Use L-BFGS algorithm to optimize randomly generated quadratic bowls.
code: def test_lbfgs_minimize(self):
      """Use L-BFGS algorithm to optimize randomly generated quadratic bowls."""
  
      np.random.seed(12345)
      dim = 10
      batches = 50
      minima = np.random.randn(batches, dim)
      scales = np.exp(np.random.randn(batches, dim))
  
      @tff_math.make_val_and_grad_fn
      def quadratic(x):
          return tf.reduce_sum(
              input_tensor=scales * (x - minima) ** 2, axis=-1
          )
  
      start = tf.ones((batches, dim), dtype="float64")
  
      results = self.evaluate(
          tff_math.optimizer.lbfgs_minimize(
              quadratic,
              initial_position=start,
              stopping_condition=tff_math.optimizer.converged_any,
              tolerance=1e-8,
          )
      )
  
      self.assertTrue(results.converged.any())
      self.assertEqual(results.position.shape, minima.shape)
      self.assertNDArrayNear(
          results.position[results.converged],
          minima[results.converged],
          1e-5,
      )
  
file_path: tf-quant-finance/tf_quant_finance/math/optimizer/optimizer_test.py
imports: import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 2 for calling the OptimizerTest obj's underlying member method code with example usage: obj.test_lbfgs_minimize() and returns: tf