class_docstr: Tests for Nelder-Mead optimization algorithm.
class_docstr_tok: ["Tests","for","Nelder-Mead","optimization","algorithm","."]
docstr: Can minimize the square root function.
docstr_tok: ["Can","minimize","the","square","root","function","."]
code: def test_sqrt_quadratic_function(self):
      """Can minimize the square root function."""
      minimum = np.array([0.0, 0.0, 0.0, 0.0])
  
      def sqrt_quad(x):
          return tf.sqrt(tf.reduce_sum(x**2, axis=-1))
  
      start = tf.constant([1.2, 0.4, -1.8, 2.9])
      results = self.evaluate(
          nelder_mead.minimize(
              sqrt_quad,
              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 7 for calling the NelderMeadTest obj's underlying member method code with example usage: obj.test_sqrt_quadratic_function() and returns: tf