class_docstr: Tests for BFGS optimization algorithm.
class_docstr_tok: ["Tests","for","BFGS","optimization","algorithm","."]
docstr: Tests minimization on the Himmelblau's function.
  
  Himmelblau's function is a standard optimization test case. The function is
  given by:
  
    f(x, y) = (x^2 + y - 11)^2 + (x + y^2 - 7)^2
  
  The function has four minima located at (3, 2), (-2.805118, 3.131312),
  (-3.779310, -3.283186), (3.584428, -1.848126).
  
  All these minima may be reached from appropriate starting points.
  
  Args:
    start: Start position.
    expected_minima: Location of minima that this optimization gets to.
    expected_evals: Number of expected function evaluations.
docstr_tok: ["Tests","minimization","on","the","Himmelblau","'s","function",".","Himmelblau","'s","function","is","a","standard","optimization","test","case",".","The","function","is","given","by",":","f","(","x",",","y",")","=","(","x^2","+","y","-","11",")","^2","+","(","x","+","y^2","-","7",")","^2","The","function","has","four","minima","located","at","(","3",",","2",")",",","(","-2.805118",",","3.131312",")",",","(","-3.779310",",","-3.283186",")",",","(","3.584428",",","-1.848126",")",".","All","these","minima","may","be","reached","from","appropriate","starting","points",".","Args",":","start",":","Start","position",".","expected_minima",":","Location","of","minima","that","this","optimization","gets","to",".","expected_evals",":","Number","of","expected","function","evaluations","."]
code: def test_himmelblau(self, start, expected_minima, expected_evals):
      """Tests minimization on the Himmelblau's function.
  
      Himmelblau's function is a standard optimization test case. The function is
      given by:
  
        f(x, y) = (x^2 + y - 11)^2 + (x + y^2 - 7)^2
  
      The function has four minima located at (3, 2), (-2.805118, 3.131312),
      (-3.779310, -3.283186), (3.584428, -1.848126).
  
      All these minima may be reached from appropriate starting points.
  
      Args:
        start: Start position.
        expected_minima: Location of minima that this optimization gets to.
        expected_evals: Number of expected function evaluations.
      """
  
      @_make_val_and_grad_fn
      def himmelblau(coord):
          x, y = coord[0], coord[1]
          return (x * x + y - 11) ** 2 + (x + y * y - 7) ** 2
  
      start = tf.constant(start, dtype=np.float64)
      results = self.evaluate(
          bfgs.minimize(
              himmelblau, initial_position=start, tolerance=1e-8
          )
      )
      self.assertTrue(results.converged)
      self.assertArrayNear(
          results.position,
          np.array(expected_minima, dtype=np.float64),
          1e-5,
      )
      self.assertEqual(
          results.num_objective_evaluations, expected_evals
      )
  
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 11 for calling the BfgsTest obj's underlying member method code with example usage: obj.test_himmelblau(start, expected_minima, expected_evals) and returns: unknown