gensbi.normalizing_flows.bijections.standardize#

Fixed affine standardization bijection (non-trainable mean/std buffers).

Classes#

Standardize

Fixed affine standardization using non-trainable mean and std buffers.

Module Contents#

class gensbi.normalizing_flows.bijections.standardize.Standardize(dim)[source]#

Bases: gensbi.normalizing_flows.bijections.base.Bijection

Fixed affine standardization using non-trainable mean and std buffers.

Buffers default to identity (mean 0, std 1) and can be updated in place via set_stats(). They are stored as Mask variables so that optimizers and EMA utilities skip them.

Parameters:

dim (int) – Dimension of the data vector (length of mean and std buffers).

forward(u, cond=None)[source]#

Map noise to data by destandardizing: x = u * std + mean.

Parameters:
  • u (Array) – Noise-space input of shape (dim,).

  • cond (Array or None, optional) – Ignored; present for interface compatibility.

Returns:

  • x (Array) – Destandardized data-space output.

  • logabsdet (Array) – Log absolute determinant of the forward map: sum(log std).

inverse(x, cond=None)[source]#

Map data to noise by standardizing: u = (x - mean) / std.

Parameters:
  • x (Array) – Data-space input of shape (dim,).

  • cond (Array or None, optional) – Ignored; present for interface compatibility.

Returns:

  • u (Array) – Standardized noise-space output.

  • logabsdet (Array) – Log absolute determinant of the inverse map: -sum(log std).

set_stats(mean, std)[source]#

Update the mean and standard-deviation buffers in place.

Parameters:
  • mean (Array) – New mean values of shape (dim,).

  • std (Array) – New standard-deviation values of shape (dim,); must be strictly positive.

Returns:

This method modifies the buffers in place and returns nothing.

Return type:

None

mean[source]#
std[source]#