gensbi.normalizing_flows.bijections.chain#
Compose bijections. Stored in noise->data (forward) order.
Classes#
Sequential composition of bijections. |
Module Contents#
- class gensbi.normalizing_flows.bijections.chain.Chain(bijections)[source]#
Bases:
gensbi.normalizing_flows.bijections.base.BijectionSequential composition of bijections.
Applies bijections in the order given for
forward()(noise→data) and in reversed order forinverse()(data→noise). Log-absolute determinants accumulate by summation.bijections[-1]is closest to data space; it is the last bijection applied inforward()and the first applied ininverse().- Parameters:
bijections (list of Bijection) – Ordered list of bijections stored in noise→data (forward) order.
- forward(u, cond=None)[source]#
Map noise to data by composing all bijections in order.
- Parameters:
u (Array) – Noise-space input.
cond (Array or None, optional) – Conditioning input passed to every bijection, or
None.
- Returns:
x (Array) – Data-space output.
logabsdet (Array) – Accumulated log absolute determinant of the composed forward map.
- inverse(x, cond=None)[source]#
Map data to noise by composing all bijections in reversed order.
- Parameters:
x (Array) – Data-space input.
cond (Array or None, optional) – Conditioning input passed to every bijection, or
None.
- Returns:
u (Array) – Noise-space output.
logabsdet (Array) – Accumulated log absolute determinant of the composed inverse map.