Softmax transform mapping .
Pushes an unconstrained vector
onto the open -simplex via
. Operates on the
last axis; event_dim = 1.
The transform is over-parameterised: any constant shift along the softmax axis () yields the same , so it is not a true bijection. The standard convention used here is to anchor the inverse at (un-normalised log-probabilities), which is one canonical preimage.
Notes
Forward:
Inverse (canonical anchor):
There is no log-determinant: the map is not injective, so it has no
Jacobian determinant and log_abs_det_jacobian raises
NotImplementedError, as in the reference. A density through
SoftmaxTransform is therefore not defined; for a true bijection
between and the simplex use
StickBreakingTransform instead.
Examples
>>> import lucid
>>> from lucid.distributions.transforms import SoftmaxTransform
>>> T = SoftmaxTransform()
>>> T(lucid.tensor([0.0, 1.0, 2.0]))
tensor([0.09003, 0.2447, 0.6652])