Given a vector x, transform it in to a vector y such that
y[i] > 0, sum_i y[i] = 1.. In other words, takes a vector in
R^{k-1} (unconstrained space) and maps it to a vector in the
unit simplex in R^{k}.

This transformation is centered in that it maps the zero vector
[0., 0., ... 0.] to the center of the simplex [1/k, ... 1/k].

This bijector arises from the stick-breaking procedure for constructing
a Dirichlet distribution / Dirichlet process as defined in [Stan, 2018][1].

At first blush it may seem like the 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.

Number of dimensions in the probabilistic events being
transformed. Must be greater than or equal to
self.forward_min_event_ndims. The result is summed over the final
dimensions to produce a scalar Jacobian determinant for each event, i.e.
it has shape rank(x) - event_ndims dimensions.

name

The name to give this op.

**kwargs

Named arguments forwarded to subclass implementation.

Returns

Tensor, if this bijector is injective.
If not injective this is not implemented.

Raises

TypeError

if self.dtype is specified and y.dtype is not
self.dtype.

NotImplementedError

if neither _forward_log_det_jacobian
nor {_inverse, _inverse_log_det_jacobian} are implemented, or
this is a non-injective bijector.

Note that forward_log_det_jacobian is the negative of this function,
evaluated at g^{-1}(y).

Args

y

Tensor. The input to the 'inverse' Jacobian determinant evaluation.

event_ndims

Number of dimensions in the probabilistic events being
transformed. Must be greater than or equal to
self.inverse_min_event_ndims. The result is summed over the final
dimensions to produce a scalar Jacobian determinant for each event, i.e.
it has shape rank(y) - event_ndims dimensions.

name

The name to give this op.

**kwargs

Named arguments forwarded to subclass implementation.

Returns

ildj

Tensor, if this bijector is injective.
If not injective, returns the tuple of local log det
Jacobians, log(det(Dg_i^{-1}(y))), where g_i is the restriction
of g to the ith partition Di.