gensbi.normalizing_flows.bijections.chain#

Compose bijections. Stored in noise->data (forward) order.

Classes#

Chain

Sequential composition of bijections.

Module Contents#

class gensbi.normalizing_flows.bijections.chain.Chain(bijections)[source]#

Bases: gensbi.normalizing_flows.bijections.base.Bijection

Sequential composition of bijections.

Applies bijections in the order given for forward() (noise→data) and in reversed order for inverse() (data→noise). Log-absolute determinants accumulate by summation. bijections[-1] is closest to data space; it is the last bijection applied in forward() and the first applied in inverse().

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.

bijections[source]#