class_docstr: Tests for BFGS optimization algorithm.
class_docstr_tok: ["Tests","for","BFGS","optimization","algorithm","."]
code: def test_himmelblau_batch_any(self):
      @_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
  
      dtype = "float64"
      starts = tf.constant(
          [[1, 1], [-2, 2], [-1, -1], [1, -2]], dtype=dtype
      )
      expected_minima = np.array(
          [
              [3, 2],
              [-2.805118, 3.131312],
              [-3.779310, -3.283186],
              [3.584428, -1.848126],
          ],
          dtype=dtype,
      )
  
      # Run with `converged_any` stopping condition, to stop as soon as any of
      # the batch members have converged.
      batch_results = self.evaluate(
          bfgs.minimize(
              himmelblau,
              initial_position=starts,
              stopping_condition=bfgs_utils.converged_any,
              tolerance=1e-8,
          )
      )
  
      self.assertFalse(
          np.any(batch_results.failed)
      )  # None have failed.
      self.assertTrue(
          np.any(batch_results.converged)
      )  # At least one converged.
      self.assertFalse(
          np.all(batch_results.converged)
      )  # But not all did.
  
      # Converged points are near expected minima.
      for actual, expected in zip(
          batch_results.position[batch_results.converged],
          expected_minima[batch_results.converged],
      ):
          self.assertArrayNear(actual, expected, 1e-5)
      self.assertEqual(batch_results.num_objective_evaluations, 31)
  
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 14 for calling the BfgsTest obj's underlying member method code with example usage: obj.test_himmelblau_batch_any() and returns: unknown