class_docstr: Tests correctness of the Y = g(X) = (1 + exp(-X))^-1 transformation.
class_docstr_tok: ["Tests","correctness","of","the","Y","=","g","(","X",")","=","(","1","+","exp","(","-X",")",")","^-1","transformation","."]
code: def testBijector(self):
      self.assertStartsWith(sigmoid.Sigmoid().name, "sigmoid")
      x = (
          np.linspace(-10.0, 10.0, 100)
          .reshape([2, 5, 10])
          .astype(np.float32)
      )
      y = special.expit(x)
      ildj = -np.log(y) - np.log1p(-y)
      bijector = sigmoid.Sigmoid()
      self.assertAllClose(
          y, self.evaluate(bijector.forward(x)), atol=0.0, rtol=1e-2
      )
      self.assertAllClose(
          x, self.evaluate(bijector.inverse(y)), atol=0.0, rtol=1e-4
      )
      self.assertAllClose(
          ildj,
          self.evaluate(
              bijector.inverse_log_det_jacobian(y, event_ndims=0)
          ),
          atol=0.0,
          rtol=1e-6,
      )
      self.assertAllClose(
          -ildj,
          self.evaluate(
              bijector.forward_log_det_jacobian(x, event_ndims=0)
          ),
          atol=0.0,
          rtol=1e-4,
      )
  
imports: from absl.testing import parameterized
  import numpy
  from scipy import special
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.bijectors import chain
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.bijectors import shift
  from tensorflow_probability.python.bijectors import sigmoid
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 1 for calling the SigmoidBijectorTest obj's underlying member method code with example usage: obj.testBijector() without return types