Activation Functions
Functions that shape each neuron's output, from ReLU to recent variants, with formulas, plots, and PyTorch code.
- Adaptive Piecewise Linear (APL)APL is an activation function that adds bends (hinges) to ReLU and learns their positions and slopes for each neuron. By learning a shape that fits the data, it has been reported to achieve higher accuracy than ReLU.
- Average Biased ReLU (AB-ReLU)ABReLU is a data-dependent variant of ReLU that handles negative values by shifting the input horizontally according to the mean of the features.
- Bendable Linear Units (BLU)BLU is a smooth activation function whose bend can be tuned, through a single learnable parameter β, anywhere between the identity function and a rectifier-like shape.
- BReLUBReLU is an activation function proposed to improve training stability by limiting the output of ReLU to a fixed range.
- Concatenated ReLU (CReLU)CReLU is an activation function motivated by the pairing of filters in the early layers of CNNs. By explicitly preserving both positive and negative phase information, it improves parameter efficiency, reconstruction ability, and regularization, enabling higher-performing CNN models.
- Continuously Differentiable ELU (CELU)CELU is an activation function proposed as an improved version of ELU. Like ELU, it mitigates the dying ReLU problem, and it is continuously differentiable over its entire domain.
- Displaced ReLU (DisReLU)DisReLU is an activation function designed to take negative values into account by shifting the rectification point.
Dual ReLUDual ReLU is a two-dimensional activation function proposed as a replacement for tanh in quasi-recurrent neural networks (QRNNs).- E-SwishESwish is an activation function defined on the basis of the Swish function. It multiplies the whole function by a fixed parameter β (a hyperparameter) to control the slope in the positive direction.
- Elastic ReLU (EReLU)EReLU is an activation function proposed to increase the nonlinearity of ReLU.
- ElliottAn activation function proposed as a more computationally efficient alternative to the sigmoid function, with a similar input-output relationship.
- Exponential Linear Sigmoid Squashing (ELiSH)ELiSH is an activation function that uses the product of ELU and the sigmoid function for negative inputs and Swish for positive inputs.
- Exponential Linear Unit (ELU)ELU is one of the functions proposed to fix the inactivation on negative inputs (the vanishing gradient problem) of ReLU-based activation functions.
- Fast ELU (FELU)FELU is an activation function proposed to make ELU more efficient by using simple bit operations and integer arithmetic.
- Flexible ReLU (FReLU)FReLU is an activation function proposed to address a weakness of conventional ReLU: the loss of information caused by forcing negative values to zero.
- Gaussian Error Linear Unit (GELU)GELU is an activation function that views nonlinearity as a transformation driven by stochastic regularization.
- Hard ELiSHHardELiSH is a hard approximation of ELiSH that replaces its sigmoid function with the hard sigmoid: an activation function that achieves a similar effect at a lower computational cost.
- HexpoAn activation function shaped like the Tanh function whose gradient can be adjusted with (non-learnable) parameters.
- Improved Sigmoid (ISigmoid)An activation function that mitigates the vanishing gradient problem by combining the sigmoid function with linear functions.
- Leaky ReLULeaky ReLU is a widely used activation function that mitigates the dying ReLU problem of the ReLU function.
- Linearly Scaled Hyperbolic Tangent (LiSHT)An activation function that mitigates the vanishing gradient problem by multiplying the output of the Tanh function by the input.
- Lipschitz ReLU (L-ReLU)L-ReLU is an activation function that uses piecewise linear functions to model the degree of presence and absence of features.
- MaxoutMaxout is an activation function in which each unit computes k linear outputs and returns their maximum. It learns the shape of the activation function itself, trains well together with dropout, and achieved state-of-the-art accuracy at the time on MNIST, CIFAR-10, CIFAR-100, and SVHN.
- Mexican ReLU (MeLU)The MeLU function is an activation function that adds Mexican-hat-shaped functions to PReLU so that it can learn nonlinearity more flexibly.
- MishThe Mish function is a self-regularizing activation function that combines the Softplus and Tanh functions.
- Multi-bin Trainable Linear Units (MTLU)MTLU is an activation function that increases nonlinearity by splitting the input into bins and applying a linear function with its own learnable parameters to each bin.
- Multiple PELU (MPELU)The MPELU function is an activation function that extends ELU and includes ReLU, PReLU, and ELU as special cases.
- Natural-Logarithm ReLU (NLReLU)NLReLU is an activation function that modifies the output of ReLU for positive inputs with a logarithm in order to increase nonlinearity.
- Padé Activation Unit (PAU)PAU was proposed for learning flexible activation functions and is defined as a rational function.
- Paired ReLUPaired ReLU combines multiple ReLU units with different parameters, which is thought to extract more diverse features and help capture the information needed to reconstruct high-resolution images.
- Parametric Deformable ELU (PDELU)PDELU is an activation function that uses a flexible map shape to push the mean of its output toward 0.
- Parametric ELU (PELU)The PELU function is an activation function based on ELU that introduces learnable parameters to make its behavior more flexible.
- Parametric Rectified Exponential Unit (PREU)PREU is an exponential activation function with learnable parameters (α, β), designed to make effective use of negative information.
- Parametric ReLU (PReLU)PReLU is an activation function widely used to mitigate the dying ReLU problem of the ReLU function.
- Parametric Tan Hyperbolic Linear Unit (P-TELU)P-TELU is an adaptive activation function with learnable parameters α and β.
- Penalized Tanh (pTanh)An activation function that multiplies the negative side of the Tanh function by a coefficient a (0 < a < 1, not learned).
- Rand Softplus (RSP)RSP is one of the variants derived from the Softplus function.
- Random Translation ReLU (RTReLU)RTReLU is an activation function proposed to address ReLU's failure to make use of negative values.
- Randomized ReLU (RReLU)RReLU is an activation function used to mitigate the dying ReLU problem of ReLU.
- Rectified Hyperbolic Secant (ReSech)ReSech was proposed as a differentiable, bounded activation function.
- Rectified Power Unit (RePU)RePU is an activation function that generalizes the positive input region of ReLU.
- ReLUReLU is an activation function that outputs the input unchanged when it is positive and 0 when it is 0 or below. It is cheap to compute and lets even deep networks train well, which makes it the standard choice for hidden layers.
- Scaled ELU (SELU)SELU introduces a scaling hyperparameter (λ) into ELU so that the gradient for positive inputs exceeds 1. This promotes self-normalization: activations automatically converge to zero mean and unit variance.
- Scaled Sigmoid (sSigmoid)An activation function that multiplies the sigmoid by 4 and subtracts 2, matching the shape of Tanh near the origin. It eases the training difficulties caused by the sigmoid's small slope of 1/4 near the origin and its non-zero output mean.
- Scaled Tanh (sTanh)An activation function that introduces (non-learnable) parameters into the Tanh function.
Self-Learnable Activation Function (SLAF)SLAF is a type of learnable activation function: an adaptive activation function that adjusts its nonlinearity based on the data and the complexity of the network.- SigmoidAn activation function used since the early days, together with the Tanh function, to introduce nonlinearity into neural networks.
- Sigmoid-Weighted Linear Units (SiLU)An activation function that multiplies the input by the output of the sigmoid function, mitigating the vanishing gradient problem.
- Soft-Root-Sign (SRS)An activation function that introduces learnable parameters.
- SoftplusSoftplus is a smooth activation function, and a number of variants of it have been proposed.
- SoftsignSoftsign is an activation function with a smooth S-shaped curve, like the sigmoid function.
- Spline Activation Function (SAF)SAF is an activation function whose shape adapts dynamically to each unit of a neural network.
- SwishSwish is an activation function discovered through automated search.
- TanhAn activation function that, together with the sigmoid function, has been used since the early days to introduce nonlinearity into neural networks.
- Trainable Activation Function (TAF)TAF uses linear regression to learn the activation function of each neuron, so that different neurons can have different activation functions.
- vReLUvReLU was proposed as an activation function with a V-shaped curve.
