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.