class_docstr: Tests for Nelder-Mead optimization algorithm.
class_docstr_tok: ["Tests","for","Nelder-Mead","optimization","algorithm","."]
docstr: Can minimize a quadratic function with initial simplex.
docstr_tok: ["Can","minimize","a","quadratic","function","with","initial","simplex","."]
code: def test_quadratic_bowl_with_initial_simplex(self):
      """Can minimize a quadratic function with initial simplex."""
      minimum = np.array([1.0, 1.0])
      scales = np.array([2.0, 3.0])
  
      def quadratic(x):
          return tf.reduce_sum(
              scales * tf.math.squared_difference(x, minimum), axis=-1
          )
  
      initial_simplex = tf.constant(
          [[0.6, 0.8], [5.0, 4.1], [-1.4, -3.2]]
      )
      results = self.evaluate(
          nelder_mead.minimize(
              quadratic,
              initial_simplex=initial_simplex,
              func_tolerance=1e-12,
              batch_evaluate_objective=True,
          )
      )
      self.assertTrue(results.converged)
      self.assertArrayNear(results.position, minimum, 1e-6)
  
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 nelder_mead
label_desc: Use image node_id 2 for calling the NelderMeadTest obj's underlying member method code with example usage: obj.test_quadratic_bowl_with_initial_simplex() and returns: tf