LostTech.TensorFlow : API Documentation

Type Softplus

Namespace tensorflow.contrib.distributions.bijectors

Parent Bijector

Interfaces ISoftplus

Bijector which computes `Y = g(X) = Log[1 + exp(X)]`.

The softplus `Bijector` has the following two useful properties:

* The domain is the positive real numbers * `softplus(x) approx x`, for large `x`, so it does not overflow as easily as the `Exp` `Bijector`.

The optional nonzero `hinge_softness` parameter changes the transition at zero. With `hinge_softness = c`, the bijector is:

```f_c(x) := c * g(x / c) = c * Log[1 + exp(x / c)].```

For large `x >> 1`, `c * Log[1 + exp(x / c)] approx c * Log[exp(x / c)] = x`, so the behavior for large `x` is the same as the standard softplus.

As `c > 0` approaches 0 from the right, `f_c(x)` becomes less and less soft, approaching `max(0, x)`.

* `c = 1` is the default. * `c > 0` but small means `f(x) approx ReLu(x) = max(0, x)`. * `c < 0` flips sign and reflects around the `y-axis`: `f_{-c}(x) = -f_c(-x)`. * `c = 0` results in a non-bijective transformation and triggers an exception.

Example Use: Note: log(.) and exp(.) are applied element-wise but the Jacobian is a reduction over the event space.
Show Example
# Create the Y=g(X)=softplus(X) transform which works only on Tensors with 1
            # batch ndim and 2 event ndims (i.e., vector of matrices).
            softplus = Softplus()
            x = [[[1., 2],
                  [3, 4]],
                 [[5, 6],
                  [7, 8]]]
            log(1 + exp(x)) == softplus.forward(x)
            log(exp(x) - 1) == softplus.inverse(x) 

Properties

Public properties

object dtype get;

object dtype_dyn get;

object forward_min_event_ndims get;

object forward_min_event_ndims_dyn get;

IList<object> graph_parents get;

object graph_parents_dyn get;

Tensor hinge_softness get;

object hinge_softness_dyn get;

object inverse_min_event_ndims get;

object inverse_min_event_ndims_dyn get;

bool is_constant_jacobian get;

object is_constant_jacobian_dyn get;

object name get;

object name_dyn get;

object PythonObject get;

bool validate_args get;

object validate_args_dyn get;