Normalizer

class Normalizer(*args, **kwargs)[source]

Bases: Module, ABC

Interface for a normalizer.

A normalizer transforms the input graph features into a distribution more suitable for neural network training (e.g., standardization, normalization).

Return type:

Any

Implementations

class CenterReduceNormalizer(*args, **kwargs)[source]

Bases: Normalizer

Graph-level wrapper that maintains an HyperEdgeSetCenterReduceNormalizer for each hyper-edge set key.

For a given feature of a given hyper-edge set class, the output is defined as follows.

\[x' = \frac{x - \mu}{\sqrt{\sigma^2} + \epsilon}\]

where \(\mu\) (resp. \(\sigma^2\)) is the exponential moving average of the empirical mean (resp. variance) with decay rate beta_1 (resp. beta_2).

Parameters:
  • in_structure – GraphStructure of the input graph.

  • update_limit – Threshold for the maximum updates to be performed.

  • beta_1 – Exponential decay rate for the first moment estimates. Defaults to 0.9.

  • beta_2 – Exponential decay rate for the second moment estimates. Defaults to 0.999.

  • epsilon – Small constant added to improve numerical stability. Defaults to 1e-6.

  • use_running_average – Flag that indicates whether to use a running average or not. Defaults to False. Automatically set to True in eval mode and to False in train mode.

Return type:

Any

class TDigestNormalizer(*args, **kwargs)[source]

Bases: Normalizer

Graph-level normalizer that maintains a TDigestModule for each hyper-edge set type.

This normalizer uses T-Digests to map feature distributions to a target grid (usually [-1, 1]), providing a non-parametric alternative to standard normalization.

Return type:

Any