Skip to content

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 defines A. Can also be a batch of matrices. Whether A is the lower or upper triangular part of matrix is determined by is_lower.
  • is_lower: if True, A is set to the lower triangular part of matrix. If False, A is set to the upper triangular part of matrix.