class_docstr: Tests for Differential Evolution optimization algorithm.
class_docstr_tok: ["Tests","for","Differential","Evolution","optimization","algorithm","."]
docstr: Tests that results with batch evaluate same as non-batch evaluate.
docstr_tok: ["Tests","that","results","with","batch","evaluate","same","as","non-batch","evaluate","."]
code: def test_docstring_example(self):
      """Tests that results with batch evaluate same as non-batch evaluate."""
  
      def easom(z):
          """The value of the two dimensional Easom function.
  
          The Easom function is a standard optimization test function. It has
          a single global minimum at (pi, pi) which is located inside a deep
          funnel. The expression for the function is:
  
          ```None
          f(x, y) = -cos(x) cos(y) exp(-(x-pi)**2 - (y-pi)**2)
          ```
  
          Args:
            z: `Tensor` of shape [2] and real dtype. The argument at which to
              evaluate the function.
  
          Returns:
            value: Scalar real `Tensor`. The value of the Easom function at the
              supplied argument.
          """
          f1 = tf.reduce_prod(tf.cos(z), axis=-1)
          f2 = tf.exp(-tf.reduce_sum((z - np.pi) ** 2, axis=-1))
          return -f1 * f2
  
      start = tf.constant([1.3, 2.2], dtype=tf.float64)
      results = self.evaluate(
          differential_evolution.minimize(
              easom,
              initial_position=start,
              func_tolerance=1e-12,
              seed=47564,
          )
      )
      self.assertTrue(results.converged)
      self.assertArrayNear(results.position, [np.pi, np.pi], 1e-5)
  
file_path: probability/tensorflow_probability/python/optimizer/differential_evolution_test.py
imports: import numpy
  from scipy.stats import special_ortho_group
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.optimizer import differential_evolution
label_desc: Use image node_id 9 for calling the DifferentialEvolutionTest obj's underlying member method code with example usage: obj.test_docstring_example() and returns: unknown