class_docstr: Bijector that computes the logistic sigmoid function.
  
  If the `low` and `high` parameters are not passed, the transformation is
  equivalent to `Y = g(X) = 1 / (1 + exp(-X))`, the same as `tf.sigmoid`.
  
  If the `low` and `high` parameters are passed, the transformation is
  equivalent to `low + (high - low) * g(X)` (with `g(X)` as defined above),
  a sigmoid that is shifted and scaled along the output axis. This is
  implemented as `high * g(X) + low * g(-X)`, which is more numerically
  stable than direct shifting and scaling.
  
  Specifically, `low + (high - low) * g(X)` can sometimes evalaute
  to slightly larger than `high`, which would trigger assertions
  elsewhere.  The formula `high * g(X) + low * g(-X)` doesn't do that.
class_docstr_tok: ["Bijector","that","computes","the","logistic","sigmoid","function",".","If","the","`","low","`","and","`","high","`","parameters","are","not","passed",",","the","transformation","is","equivalent","to","`","Y","=","g","(","X",")","=","1","\/","(","1","+","exp","(","-X",")",")","`",",","the","same","as","`","tf.sigmoid","`",".","If","the","`","low","`","and","`","high","`","parameters","are","passed",",","the","transformation","is","equivalent","to","`","low","+","(","high","-","low",")","*","g","(","X",")","`","(","with","`","g","(","X",")","`","as","defined","above",")",",","a","sigmoid","that","is","shifted","and","scaled","along","the","output","axis",".","This","is","implemented","as","`","high","*","g","(","X",")","+","low","*","g","(","-X",")","`",",","which","is","more","numerically","stable","than","direct","shifting","and","scaling",".","Specifically",",","`","low","+","(","high","-","low",")","*","g","(","X",")","`","can","sometimes","evalaute","to","slightly","larger","than","`","high","`",",","which","would","trigger","assertions","elsewhere",".","The","formula","`","high","*","g","(","X",")","+","low","*","g","(","-X",")","`","does","n't","do","that","."]
code: def _forward(self, x):
      if self._is_standard_sigmoid:
          return _stable_sigmoid(x)
      lo = tf.convert_to_tensor(self.low)  # Concretize only once
      hi = tf.convert_to_tensor(self.high)
      diff = hi - lo
      left = lo + diff * _stable_sigmoid(x)
      right = hi - diff * _stable_sigmoid(-x)
      return tf.where(x < 0, left, right)
  
file_path: probability/tensorflow_probability/python/bijectors/sigmoid.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import tensor_util
label_desc: Use image node_id 6 for calling the Sigmoid obj's underlying member method code with example usage: obj._forward(x) and returns: tf, _stable_sigmoid