Exponential Activation Functions
Exponential (ELU-based) activation functions.
Implements the exponential-linear family surveyed in arXiv:2109.14545 §5: ELU and its scaled, parametric, deformable, and combined variants.
- class src.model.activation_function.exponential.CELU(*args: Any, **kwargs: Any)[source]
Bases:
ModuleContinuously Differentiable ELU:
xifx >= 0elsealpha * (e^{x/alpha} - 1).Range
(-alpha, inf). Unlike ELU, CELU is once-differentiable at 0 for anyalpha. Reference: Barron (2017), arXiv:1704.07483; survey §5.- Parameters:
alpha – Saturation value for negative inputs. Default:
1.0.
- alpha
The negative-saturation constant.
- class src.model.activation_function.exponential.EELU(*args: Any, **kwargs: Any)[source]
Bases:
ModuleElastic ELU: ELU with learnable
alphaand a positive-region slopebeta.beta * max(0, x) + alpha * min(0, e^x - 1). Reference: survey §5.- Parameters:
dim – Number of features.
alpha_init – Initial negative saturation. Default:
1.0.beta_init – Initial positive slope. Default:
1.0.
- alpha
Learnable negative saturation of shape
(dim,).
- beta
Learnable positive slope of shape
(dim,).
- class src.model.activation_function.exponential.ELU(*args: Any, **kwargs: Any)[source]
Bases:
ModuleExponential Linear Unit:
xifx >= 0elsealpha * (e^x - 1).Range
(-alpha, inf). Smooth negative saturation; mean closer to zero than ReLU. Reference: Clevert et al. (2016), arXiv:1511.07289; Lederer §2.3.2; survey §5.- Parameters:
alpha – Saturation value for negative inputs. Default:
1.0.
- alpha
The negative-saturation constant.
- class src.model.activation_function.exponential.ELiSH(*args: Any, **kwargs: Any)[source]
Bases:
ModuleExponential Linear Sigmoid SquasHing.
x * sigmoid(x)forx >= 0and(e^x - 1) / (1 + e^{-x})forx < 0(Swish positive branch, ELU-gated negative branch). Reference: Basirat & Roth (2019), survey §5.
- class src.model.activation_function.exponential.FELU(*args: Any, **kwargs: Any)[source]
Bases:
ModuleFast ELU: like ELU but
alphais learnable and clamped to[0, 1].A numerically cheaper variant that restricts the saturation constant. Reference: survey §5.
- Parameters:
dim – Number of features.
alpha_init – Initial saturation value. Default:
1.0.
- alpha
Learnable saturation of shape
(dim,).
- class src.model.activation_function.exponential.HardELiSH(*args: Any, **kwargs: Any)[source]
Bases:
ModuleHard ELiSH: ELiSH with a hard-sigmoid approximation.
x * relu6(x + 3) / 6forx >= 0and(e^x - 1) * relu6(x + 3) / 6otherwise. Reference: Basirat & Roth (2019), survey §5.
- class src.model.activation_function.exponential.MPELU(*args: Any, **kwargs: Any)[source]
Bases:
ModuleMulti-Parametric ELU: ELU with learnable
alphaand a PReLU-like slopebeta.max(0, x) + beta * min(0, alpha * (e^x - 1)). Generalizes both ELU and PReLU. Reference: survey §5.- Parameters:
dim – Number of features.
alpha_init – Initial ELU saturation. Default:
1.0.beta_init – Initial negative slope. Default:
1.0.
- alpha
Learnable saturation of shape
(dim,).
- beta
Learnable negative slope of shape
(dim,).
- class src.model.activation_function.exponential.PDELU(*args: Any, **kwargs: Any)[source]
Bases:
ModuleParametric Deformable ELU.
xifx >= 0elsealpha * (e^{x/alpha} - 1) + (1 - alpha) * x. Learnablealphainterpolates between CELU and the identity on the negative branch. Reference: survey §5.- Parameters:
dim – Number of features.
alpha_init – Initial deformation in
(0, 1]. Default:1.0.
- alpha
Learnable deformation parameter of shape
(dim,).
- class src.model.activation_function.exponential.PELU(*args: Any, **kwargs: Any)[source]
Bases:
ModuleParametric ELU:
alpha/beta * xifx >= 0elsealpha * (e^{x/beta} - 1).Both
alphaandbetaare learnable, generalizing ELU. Reference: Trottier et al. (2017), arXiv:1605.09332; survey §5.- Parameters:
dim – Number of features.
alpha/betahave shape(dim,).alpha_init – Initial positive saturation. Default:
1.0.beta_init – Initial positive scale. Default:
1.0.
- alpha
Learnable saturation parameter of shape
(dim,).
- beta
Learnable scale parameter of shape
(dim,).
- class src.model.activation_function.exponential.PREU(*args: Any, **kwargs: Any)[source]
Bases:
ModuleParametric Rectified Exponential Unit.
max(0, x) + alpha * min(0, e^x - 1)with learnablealpha(negative branch) andbeta(positive-branch slope). Range(-alpha, inf). Reference: survey §5.- Parameters:
dim – Number of features.
alpha_init – Initial negative saturation. Default:
1.0.beta_init – Initial positive slope. Default:
1.0.
- alpha
Learnable negative saturation of shape
(dim,).
- beta
Learnable positive slope of shape
(dim,).
- class src.model.activation_function.exponential.SELU(*args: Any, **kwargs: Any)[source]
Bases:
ModuleScaled Exponential Linear Unit.
scale * xifx >= 0elsescale * alpha * (e^x - 1)with fixedalpha ~= 1.6733andscale ~= 1.0507. Induces self-normalizing activations that keep mean 0 and variance 1. Reference: Klambauer et al. (2017), arXiv:1706.02515; Lederer §2.3.2; survey §5.
- class src.model.activation_function.exponential.SoftExp(*args: Any, **kwargs: Any)[source]
Bases:
ModuleSoft Exponential: interpolates between exponential, linear, and logarithmic.
For
alpha < 0:-(log(1 - alpha*(x + alpha))) / alpha;alpha == ``: ``x;alpha > 0:(exp(alpha * x) - 1) / alpha + alpha.alphais learnable. Reference: survey §5, Godfrey & Gashler (2015).- Parameters:
dim – Number of features.
alpha_init – Initial interpolation parameter. Default:
0.0.
- alpha
Learnable interpolation parameter of shape
(dim,).