class_docstr: Tests for Nelder-Mead optimization algorithm.
class_docstr_tok: ["Tests","for","Nelder-Mead","optimization","algorithm","."]
docstr: Can minimize a ten dimensional quadratic function.
docstr_tok: ["Can","minimize","a","ten","dimensional","quadratic","function","."]
code: def test_quadratic_bowl_10d(self):
      """Can minimize a ten dimensional quadratic function."""
      dim = 10
      np.random.seed(14159)
      minimum = np.random.randn(dim)
      scales = np.exp(np.random.randn(dim))
  
      def quadratic(x):
          return tf.reduce_sum(
              scales * tf.math.squared_difference(x, minimum), axis=-1
          )
  
      start = tf.ones_like(minimum)
      results = self.evaluate(
          nelder_mead.minimize(
              quadratic,
              initial_vertex=start,
              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 4 for calling the NelderMeadTest obj's underlying member method code with example usage: obj.test_quadratic_bowl_10d() and returns: tf