LostTech.TensorFlow : API Documentation

Type AbsoluteValue

Namespace tensorflow.contrib.distributions.bijectors

Parent Bijector

Interfaces IAbsoluteValue

Computes `Y = g(X) = Abs(X)`, element-wise.

This non-injective bijector allows for transformations of scalar distributions with the absolute value function, which maps `(-inf, inf)` to `[0, inf)`.

* For `y in (0, inf)`, `AbsoluteValue.inverse(y)` returns the set inverse `{x in (-inf, inf) : |x| = y}` as a tuple, `-y, y`. * `AbsoluteValue.inverse(0)` returns `0, 0`, which is not the set inverse (the set inverse is the singleton `{0}`), but "works" in conjunction with `TransformedDistribution` to produce a left semi-continuous pdf. * For `y < 0`, `AbsoluteValue.inverse(y)` happily returns the wrong thing, `-y, y`. This is done for efficiency. If `validate_args == True`, `y < 0` will raise an exception.
Show Example
```tfd = tf.contrib.distributions  abs = tfd.bijectors.AbsoluteValue()  abs.forward([-1., 0., 1.])
==> [1., 0.,  1.]  abs.inverse(1.)
==> [-1., 1.]  # The |dX/dY| is constant, == 1.  So Log|dX/dY| == 0.
abs.inverse_log_det_jacobian(1.)
==> [0., 0.]  # Special case handling of 0.
abs.inverse(0.)
==> [0., 0.]  abs.inverse_log_det_jacobian(0.)
==> [0., 0.] ```