docstr: checked calculations by hand, e.g.,
  np.exp(-((2.0 - 1.5)**2 / (2.0**2) + (2.5 - 2.0)**2 / (1.5**2)) / 2)
  np.exp(-((2.0 - 3.1)**2 / (2.0**2) + (2.5 - 4.2)**2 / (1.5**2)) / 2)
  np.exp(-((4.1 - 1.5)**2 / (2.0**2) + (5.0 - 2.0)**2 / (1.5**2)) / 2)
  np.exp(-((4.1 - 3.1)**2 / (2.0**2) + (5.0 - 4.2)**2 / (1.5**2)) / 2)
docstr_tok: ["checked","calculations","by","hand",",","e.g.",",","np.exp","(","-","(","(","2.0","-","1.5",")","*","*","2","\/","(","2.0","*","*","2",")","+","(","2.5","-","2.0",")","*","*","2","\/","(","1.5","*","*","2",")",")","\/","2",")","np.exp","(","-","(","(","2.0","-","3.1",")","*","*","2","\/","(","2.0","*","*","2",")","+","(","2.5","-","4.2",")","*","*","2","\/","(","1.5","*","*","2",")",")","\/","2",")","np.exp","(","-","(","(","4.1","-","1.5",")","*","*","2","\/","(","2.0","*","*","2",")","+","(","5.0","-","2.0",")","*","*","2","\/","(","1.5","*","*","2",")",")","\/","2",")","np.exp","(","-","(","(","4.1","-","3.1",")","*","*","2","\/","(","2.0","*","*","2",")","+","(","5.0","-","4.2",")","*","*","2","\/","(","1.5","*","*","2",")",")","\/","2",")"]
code: def test_lengthscale(self):
      """checked calculations by hand, e.g.,
      np.exp(-((2.0 - 1.5)**2 / (2.0**2) + (2.5 - 2.0)**2 / (1.5**2)) / 2)
      np.exp(-((2.0 - 3.1)**2 / (2.0**2) + (2.5 - 4.2)**2 / (1.5**2)) / 2)
      np.exp(-((4.1 - 1.5)**2 / (2.0**2) + (5.0 - 2.0)**2 / (1.5**2)) / 2)
      np.exp(-((4.1 - 3.1)**2 / (2.0**2) + (5.0 - 4.2)**2 / (1.5**2)) / 2)
      """
      with self.test_session():
          X = tf.constant([[2.0, 2.5], [4.1, 5.0]])
          X2 = tf.constant([[1.5, 2.0], [3.1, 4.2]])
          lengthscale1 = tf.constant(2.0)
          lengthscale2 = tf.constant([2.0, 2.0])
          lengthscale3 = tf.constant([2.0, 1.5])
          self.assertAllClose(
              rbf(X, X2, lengthscale1).eval(),
              [[0.939413, 0.598996], [0.139456, 0.814647]],
              atol=1e-5,
              rtol=1e-5,
          )
          self.assertAllClose(
              rbf(X, X2, lengthscale2).eval(),
              [[0.939413, 0.598996], [0.139456, 0.814647]],
              atol=1e-5,
              rtol=1e-5,
          )
          self.assertAllClose(
              rbf(X, X2, lengthscale3).eval(),
              [[0.916855, 0.452271], [0.058134, 0.765502]],
              atol=1e-5,
              rtol=1e-5,
          )
  
file_path: edward/tests/util/rbf_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  from edward.util import rbf
label_desc: Use image node_id 3 for calling the test_rbf_class obj's underlying member method code with example usage: obj.test_lengthscale() without return types