DeRF Normalization
Derf normalization layer.
Applies the error function (erf) as a smooth, saturating non-linearity with learnable affine parameters.
- class src.model.norm.derf.Derf(*args: Any, **kwargs: Any)[source]
Bases:
ModuleDerf normalization layer.
Applies the error function (erf) as a smooth, saturating non-linearity with learnable affine parameters. The formulation is:
y = gamma * erf(alpha * x + s) + beta
where
alphaandsare scalar parameters controlling the slope and shift of the erf, andgamma,betaare per-dimension scale and bias.- Parameters:
dim – Number of features in the input (normalized dimension).
- alpha
Learnable scalar slope parameter, initialized to 1.0.
- s
Learnable scalar shift parameter, initialized to 0.0.
- gamma
Learnable per-dimension scale of shape
(dim,), initialized to 1.
- beta
Learnable per-dimension bias of shape
(dim,), initialized to 0.