Dynamic Tanh Normalization
Dynamic Tanh normalization layer.
Applies standard normalization (subtract mean, divide by standard deviation)
followed by a learnable affine transformation through tanh.
- class src.model.norm.dynamic_tanh.DynamicTanhNorm(*args: Any, **kwargs: Any)[source]
Bases:
ModuleDynamic Tanh normalization layer.
Applies standard normalization (subtract mean, divide by standard deviation) followed by a learnable affine transformation through
tanh. The learnable parametersalphaandbetaallow the layer to adapt the saturation point and slope of the tanh non-linearity per dimension.- Parameters:
dim – Number of features in the input (normalized dimension).
eps – Small constant for numerical stability in standard deviation. Defaults to
1e-6.
- alpha
Learnable scale parameter of shape
(dim,), initialized to 1.
- beta
Learnable shift parameter of shape
(dim,), initialized to 0.
- eps
Epsilon value for numerical stability.