Skip to content

Abstract Bijectors¤

distreqx.bijectors._bijector.AbstractBijector ¤

Differentiable bijection that knows to compute its Jacobian determinant.

A bijector implements a differentiable and bijective transformation f, whose inverse is also differentiable (f is called a "diffeomorphism"). A bijector can be used to transform a continuous random variable X to a continuous random variable Y = f(X) in the context of TransformedDistribution.

Typically, a bijector subclass will implement the following methods:

  • forward_and_log_det(x) (required)
  • inverse_and_log_det(y) (optional)

The remaining methods are defined in terms of the above by default.

Subclass requirements:

  • Subclasses must ensure that f is differentiable and bijective, and that their methods correctly implement f^{-1}, J(f) and J(f^{-1}). Distreqx will assume these properties hold, and will make no attempt to verify them.
__init__(self) ¤

Initialize self. See help(type(self)) for accurate signature.

forward(self, x: PyTree) -> PyTree abstractmethod ¤

Computes \(y = f(x)\).

inverse(self, y: PyTree) -> PyTree abstractmethod ¤

Computes \(x = f^{-1}(y)\).

forward_log_det_jacobian(self, x: PyTree) -> PyTree abstractmethod ¤

Computes \(\log|\det J(f)(x)|\).

inverse_log_det_jacobian(self, y: PyTree) -> PyTree abstractmethod ¤

Computes \(\log|\det J(f^{-1})(y)|\).

forward_and_log_det(self, x: PyTree) -> tuple abstractmethod ¤

Computes \(y = f(x)\) and \(\log|\det J(f)(x)|\).

inverse_and_log_det(self, y: Array) -> tuple abstractmethod ¤

Computes \(x = f^{-1}(y)\) and \(\log|\det J(f^{-1})(y)|\).

same_as(self, other) -> bool abstractmethod ¤

Returns True if this bijector is guaranteed to be the same as other.

distreqx.bijectors._bijector.AbstractInvLogDetJacBijector (AbstractBijector) ¤

AbstractBijector + concrete inverse_log_det_jacobian.

inverse_log_det_jacobian(self, y: PyTree) -> PyTree ¤

distreqx.bijectors._bijector.AbstractFwdLogDetJacBijector (AbstractBijector) ¤

AbstractBijector + concrete forward_log_det_jacobian.

forward_log_det_jacobian(self, x: PyTree) -> PyTree ¤

distreqx.bijectors._bijector.AbstractFowardInverseBijector (AbstractBijector) ¤

AbstractBijector + concrete forward and reverse.

forward(self, x: PyTree) -> PyTree ¤
inverse(self, y: PyTree) -> PyTree ¤

distreqx.bijectors._linear.AbstractLinearBijector (AbstractBijector) ¤

Base class for linear bijectors.

This class provides a base class for bijectors defined as f(x) = Ax, where A is a DxD matrix and x is a D-dimensional vector.

matrix: Array property readonly ¤

The matrix A of the transformation.

To be optionally implemented in a subclass.

Returns:

  • An array of shape (D, D).
__init__(self) ¤

Initialize self. See help(type(self)) for accurate signature.