class

LowerCholeskyTransform

extendsTransform
LowerCholeskyTransform()
source

Bijection mapping an unconstrained matrix to a positive-diagonal Cholesky factor.

The standard reparameterisation used to learn covariance / scale matrices: a free D×DD \times D matrix is mapped to a lower triangular matrix with strictly positive diagonal by zeroing the strict upper triangle and applying softplus to the diagonal. Composing with a base on RD×D\mathbb{R}^{D \times D} produces a pushforward over the cone of valid Cholesky factors. event_dim = 2.

Notes

Forward (element-wise on a D×DD \times D input XX):

Lij={softplus(Xii)i=jXiji>j0i<jL_{ij} = \begin{cases} \operatorname{softplus}(X_{ii}) & i = j \\ X_{ij} & i > j \\ 0 & i < j \end{cases}

Inverse:

Xii=softplus1(Lii)=log(eLii1),Xij=Lij    (i>j)X_{ii} = \operatorname{softplus}^{-1}(L_{ii}) = \log(e^{L_{ii}} - 1), \qquad X_{ij} = L_{ij}\;\;(i > j)

Log Jacobian determinant (summed over the matrix event dims):

logdetJ=i=1Dlogσ(Xii)=i=1Dsoftplus(Xii)\log|\det J| = \sum_{i=1}^{D} \log \sigma(X_{ii}) = -\sum_{i=1}^{D} \operatorname{softplus}(-X_{ii})

Off-diagonal entries contribute unit Jacobian (identity map); only the softplus applied to the diagonal carries a non-trivial factor.

For correlation-matrix factors (unit diagonal) use CorrCholeskyTransform instead.

Examples

>>> import lucid
>>> from lucid.distributions.transforms import LowerCholeskyTransform
>>> T = LowerCholeskyTransform()
>>> X = lucid.tensor([[0.0, 0.0], [0.5, 0.0]])
>>> L = T(X)  # softplus on diagonal, raw on strict lower

Methods (1)

fn

log_abs_det_jacobian

Tensor
log_abs_det_jacobian(x: Tensor, y: Tensor)
source

Sum of logσ(xii)\log \sigma(x_{ii}) over the diagonal.

Off-diagonal entries contribute unit Jacobian; only the softplus applied to the diagonal contributes the non-trivial factor σ(x)=σ(x)\sigma'(x) = \sigma(x), computed via the stable identity logσ(x)=softplus(x)\log \sigma(x) = -\operatorname{softplus}(-x).