Transpose

class pmrf.stats.bijectors.Transpose(permutation: tuple[int, ...])

Bases: AbstractForwardInverseBijector, AbstractInvLogDetJacBijector, AbstractFwdLogDetJacBijector

A bijector that transposes the dimensions of the input array.

Initializes a Transpose bijector.

Arguments:

  • permutation: A tuple of integers representing

    the desired permutation of the axes.

forward_and_log_det(x: Array) → tuple[Array, Array]

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

inverse_and_log_det(y: Array) → tuple[Array, Array]

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

same_as(other: AbstractBijector) → bool

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

permutation: tuple[int, ...]