Triangular Linear Bijector¤
distreqx.bijectors.triangular_linear.TriangularLinear (AbstractLinearBijector)
¤
A linear bijector whose weight matrix is triangular.
The bijector is defined as f(x) = Ax
where A
is a DxD triangular matrix.
The Jacobian determinant can be computed in O(D) as follows:
log|det J(x)| = log|det A| = sum(log|diag(A)|)
The inverse is computed in O(D^2) by solving the triangular system Ax = y
.
The bijector is invertible if and only if all diagonal elements of A
are
non-zero. It is the responsibility of the user to make sure that this is the
case; the class will make no attempt to verify that the bijector is
invertible.
__init__(self, matrix: Array, is_lower: bool = True)
¤
Initializes a TriangularLinear
bijector.
Arguments:
matrix
: a square matrix whose triangular part definesA
. Can also be a batch of matrices. WhetherA
is the lower or upper triangular part ofmatrix
is determined byis_lower
.is_lower
: if True,A
is set to the lower triangular part ofmatrix
. If False,A
is set to the upper triangular part ofmatrix
.