LostTech.TensorFlow : API Documentation

Type SoftmaxCentered

Namespace tensorflow.contrib.distributions.bijectors

Parent Bijector

Interfaces ISoftmaxCentered

Bijector which computes `Y = g(X) = exp([X 0]) / sum(exp([X 0]))`.

To implement [softmax](https://en.wikipedia.org/wiki/Softmax_function) as a bijection, the forward transformation appends a value to the input and the inverse removes this coordinate. The appended coordinate represents a pivot, e.g., `softmax(x) = exp(x-c) / sum(exp(x-c))` where `c` is the implicit last coordinate.

Example Use: At first blush it may seem like the [Invariance of domain]( https://en.wikipedia.org/wiki/Invariance_of_domain) theorem implies this implementation is not a bijection. However, the appended dimension makes the (forward) image non-open and the theorem does not directly apply.
Show Example
bijector.SoftmaxCentered().forward(tf.math.log([2, 3, 4]))
            # Result: [0.2, 0.3, 0.4, 0.1]
            # Extra result: 0.1 

bijector.SoftmaxCentered().inverse([0.2, 0.3, 0.4, 0.1]) # Result: tf.math.log([2, 3, 4]) # Extra coordinate removed.


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;

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;