class_docstr: Tests for Differential Evolution optimization algorithm.
class_docstr_tok: ["Tests","for","Differential","Evolution","optimization","algorithm","."]
docstr: Can minimize a strongly skewed quadratic function.
docstr_tok: ["Can","minimize","a","strongly","skewed","quadratic","function","."]
code: def test_quadratic_with_strong_skew(self):
      """Can minimize a strongly skewed quadratic function."""
      np.random.seed(89793)
      minimum = np.random.randn(3)
      principal_values = np.diag(np.array([0.1, 2.0, 50.0]))
      rotation = special_ortho_group.rvs(3)
      hessian = np.dot(
          np.transpose(rotation), np.dot(principal_values, rotation)
      )
  
      def quadratic(x):
          y = x - minimum
          yp = tf.tensordot(hessian, y, axes=[1, 0])
          return tf.reduce_sum(y * yp) / 2
  
      def objective_func(population):
          return tf.map_fn(quadratic, population)
  
      start = tf.ones_like(minimum)
      results = self.evaluate(
          differential_evolution.minimize(
              objective_func,
              initial_position=start,
              func_tolerance=1e-12,
              max_iterations=150,
              seed=3321,
          )
      )
      self.assertTrue(results.converged)
      self.assertArrayNear(results.position, minimum, 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 5 for calling the DifferentialEvolutionTest obj's underlying member method code with example usage: obj.test_quadratic_with_strong_skew() and returns: unknown, tf