eLayerNorm#
- class eLayerNorm(in_rep, eps=1e-06, equiv_affine=True, bias=True, device=None, dtype=None, init_scheme='identity')[source]#
Bases:
ModuleEquivariant Layer Normalization.
Given \(\mathbf{x}\in\mathcal{X}\), we first move to the irrep-spectral basis \(\hat{\mathbf{x}} = \mathbf{Q}^{-1}\mathbf{x}\), compute one variance scalar per irreducible block via
irrep_radii(), and normalize each block uniformly:\[\hat{\mathbf{y}} = \frac{\hat{\mathbf{x}}}{\sqrt{\mathbf{\sigma}^{2} + \varepsilon}}, \qquad \mathbf{y} = Q\hat{\mathbf{y}}.\]The layer is equivariant:
\[\rho_{\text{in}}(g) \mathbf{y} = \text{LayerNorm}(\rho_{\text{in}}(g) \mathbf{x})\]since the statistics are computed per irreducible subspace (which are preserved by the group action).
When
equiv_affine=Truethe learnable affine step is performed directly in the spectral basis using the per-irrep scale/bias provided byeAffine.- Parameters:
in_rep (
Representation) – description of the feature space \(\rho_{\text{in}}\).eps (
float) – numerical stabilizer added to each variance.equiv_affine (
bool) – ifTrue, applies aneAffinein spectral space.bias (
bool) – whether the affine term includes invariant biases (only used ifequiv_affine).device – optional tensor factory kwargs.
dtype – optional tensor factory kwargs.
init_scheme (Literal['identity', 'random'] | None)
Note
This layer appears to generate numerical instability when used in equivariant transformer blocks. Use eRMSNorm instead in such cases.