Chain Bijector¤
distreqx.bijectors.chain.Chain (AbstractFwdLogDetJacBijector, AbstractInvLogDetJacBijector)
¤
Composition of a sequence of bijectors into a single bijector.
Bijectors are composable: if f
and g
are bijectors, then g o f
is also
a bijector. Given a sequence of bijectors [f1, ..., fN]
, this class
implements the bijector defined by fN o ... o f1
.
NOTE: the bijectors are applied in reverse order from the order they appear in
the sequence. For example, consider the following code where f
and g
are
two bijectors:
layers = []
layers.append(f)
layers.append(g)
bijector = distrax.Chain(layers)
y = bijector.forward(x)
The above code will transform x
by first applying g
, then f
, so that
y = f(g(x))
.
__init__(self, bijectors: Sequence[AbstractBijector])
¤
Initializes a Chain bijector.
Arguments:
bijectors
: a sequence of bijectors to be composed into one. Each bijector can be a distreqx bijector or a callable to be wrapped byLambda
. The sequence must contain at least one bijector.