Advantages of ReLU include:
Possible downsides can include:
Leaky ReLU allows a small, positive gradient when the unit is inactive,18 helping to mitigate the vanishing gradient problem. This gradient is defined by a parameter α {\displaystyle \alpha } , typically set to 0.01–0.3.1920
The same function can also be expressed without the piecewise notation as:
Parametric ReLU (PReLU) takes this idea further by making α {\displaystyle \alpha } a learnable parameter along with the other network parameters.21
Note that for α ≤ 1 {\displaystyle \alpha \leq 1} , this is equivalent to
and thus has a relation to "maxout" networks.22
Concatenated ReLU (CReLU) preserves positive and negative phase information:23
ExtendeD Exponential Linear Unit (DELU) is an activation function which is smoother within the neighborhood of zero and sharper for bigger values, allowing better allocation of neurons in the learning process for higher performance. Thanks to its unique design, it has been shown that DELU may obtain higher classification accuracy than ReLU and ELU.24
In these formulas, a {\displaystyle a} , b {\displaystyle b} and x c {\displaystyle x_{c}} are hyperparameter values which could be set as default constraints a = 1 {\displaystyle a=1} , b = 2 {\displaystyle b=2} and x c = 1.25643 {\displaystyle x_{c}=1.25643} , as done in the original work.
GELU is a smooth approximation to the rectifier:
where Φ ( x ) = P ( X ⩽ x ) {\displaystyle \Phi (x)=P(X\leqslant x)} is the cumulative distribution function of the standard normal distribution.
This activation function is illustrated in the figure at the start of this article. It has a "bump" to the left of x < 0 and serves as the default activation for models such as BERT.25
Main article: Swish function
The SiLU (sigmoid linear unit) or swish function26 is another smooth approximation which uses the sigmoid function, first introduced in the GELU paper:27
Main article: Softplus
A smooth approximation to the rectifier is the analytic function
which is called the softplus2829 or SmoothReLU function.30 For large negative x {\displaystyle x} it is roughly ln 1 {\displaystyle \ln 1} , so just above 0, while for large positive x {\displaystyle x} it is roughly ln ( e x ) {\displaystyle \ln(e^{x})} , so just above x {\displaystyle x} .
This function can be approximated as:
By making the change of variables x = y ln ( 2 ) {\displaystyle x=y\ln(2)} , this is equivalent to
A sharpness parameter k {\displaystyle k} may be included:
The derivative of softplus is the logistic function.
The logistic sigmoid function is a smooth approximation of the derivative of the rectifier, the Heaviside step function.
The multivariable generalization of single-variable softplus is the LogSumExp with the first argument set to zero:
The LogSumExp function is
and its gradient is the softmax; the softmax with the first argument set to zero is the multivariable generalization of the logistic function. Both LogSumExp and softmax are used in machine learning.
Exponential linear units try to make the mean activations closer to zero, which speeds up learning. It has been shown that ELUs can obtain higher classification accuracy than ReLUs.31
In these formulas, α {\displaystyle \alpha } is a hyperparameter to be tuned with the constraint α ≥ 0 {\displaystyle \alpha \geq 0} .
Given the same interpretation of α {\displaystyle \alpha } , ELU can be viewed as a smoothed version of a shifted ReLU (SReLU), which has the form f ( x ) = max ( − α , x ) {\displaystyle f(x)=\max(-\alpha ,x)} .
The mish function can also be used as a smooth approximation of the rectifier.32 It is defined as
where tanh ( x ) {\displaystyle \tanh(x)} is the hyperbolic tangent, and softplus ( x ) {\displaystyle \operatorname {softplus} (x)} is the softplus function.
Mish is non-monotonic and self-gated.33 It was inspired by Swish, itself a variant of ReLU.34
Squareplus35 is the function
where b ≥ 0 {\displaystyle b\geq 0} is a hyperparameter that determines the "size" of the curved region near x = 0 {\displaystyle x=0} . (For example, letting b = 0 {\displaystyle b=0} yields ReLU, and letting b = 4 {\displaystyle b=4} yields the metallic mean function.) Squareplus shares many properties with softplus: It is monotonic, strictly positive, approaches 0 as x → − ∞ {\displaystyle x\to -\infty } , approaches the identity as x → + ∞ {\displaystyle x\to +\infty } , and is C ∞ {\displaystyle C^{\infty }} smooth. However, squareplus can be computed using only algebraic functions, making it well-suited for settings where computational resources or instruction sets are limited. Additionally, squareplus requires no special consideration to ensure numerical stability when x {\displaystyle x} is large.
Brownlee, Jason (8 January 2019). "A Gentle Introduction to the Rectified Linear Unit (ReLU)". Machine Learning Mastery. Retrieved 8 April 2021. https://machinelearningmastery.com/rectified-linear-activation-function-for-deep-learning-neural-networks/ ↩
Liu, Danqing (30 November 2017). "A Practical Guide to ReLU". Medium. Retrieved 8 April 2021. https://medium.com/@danqing/a-practical-guide-to-relu-b83ca804f1f7 ↩
Ramachandran, Prajit; Barret, Zoph; Quoc, V. Le (October 16, 2017). "Searching for Activation Functions". arXiv:1710.05941 [cs.NE]. /wiki/ArXiv_(identifier) ↩
Xavier Glorot; Antoine Bordes; Yoshua Bengio (2011). Deep sparse rectifier neural networks (PDF). AISTATS. Rectifier and softplus activation functions. The second one is a smooth version of the first. /wiki/Yoshua_Bengio ↩
László Tóth (2013). Phone Recognition with Deep Sparse Rectifier Neural Networks (PDF). ICASSP. http://www.inf.u-szeged.hu/~tothl/pubs/ICASSP2013.pdf ↩
Andrew L. Maas, Awni Y. Hannun, Andrew Y. Ng (2014). Rectifier Nonlinearities Improve Neural Network Acoustic Models. https://ai.stanford.edu/~amaas/papers/relu_hybrid_icml2013_final.pdf ↩
Hansel, D.; van Vreeswijk, C. (2002). "How noise contributes to contrast invariance of orientation tuning in cat visual cortex". J. Neurosci. 22 (12): 5118–5128. doi:10.1523/JNEUROSCI.22-12-05118.2002. PMC 6757721. PMID 12077207. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6757721 ↩
Kadmon, Jonathan; Sompolinsky, Haim (2015-11-19). "Transition to Chaos in Random Neuronal Networks". Physical Review X. 5 (4): 041030. arXiv:1508.06486. Bibcode:2015PhRvX...5d1030K. doi:10.1103/PhysRevX.5.041030. S2CID 7813832. /wiki/ArXiv_(identifier) ↩
Engelken, Rainer; Wolf, Fred; Abbott, L. F. (2020-06-03). "Lyapunov spectra of chaotic recurrent neural networks". arXiv:2006.02427 [nlin.CD]. /wiki/ArXiv_(identifier) ↩
Householder, Alston S. (June 1941). "A theory of steady-state activity in nerve-fiber networks: I. Definitions and preliminary lemmas". The Bulletin of Mathematical Biophysics. 3 (2): 63–69. doi:10.1007/BF02478220. ISSN 0007-4985. http://link.springer.com/10.1007/BF02478220 ↩
Fukushima, K. (1969). "Visual feature extraction by a multilayered network of analog threshold elements". IEEE Transactions on Systems Science and Cybernetics. 5 (4): 322–333. doi:10.1109/TSSC.1969.300225. /wiki/Doi_(identifier) ↩
Fukushima, K.; Miyake, S. (1982). "Neocognitron: A Self-Organizing Neural Network Model for a Mechanism of Visual Pattern Recognition". Competition and Cooperation in Neural Nets. Lecture Notes in Biomathematics. Vol. 45. Springer. pp. 267–285. doi:10.1007/978-3-642-46466-9_18. ISBN 978-3-540-11574-8. {{cite book}}: |journal= ignored (help) 978-3-540-11574-8 ↩
Hahnloser, R.; Sarpeshkar, R.; Mahowald, M. A.; Douglas, R. J.; Seung, H. S. (2000). "Digital selection and analogue amplification coexist in a cortex-inspired silicon circuit". Nature. 405 (6789): 947–951. Bibcode:2000Natur.405..947H. doi:10.1038/35016072. PMID 10879535. S2CID 4399014. /wiki/Nature_(journal) ↩
Hahnloser, R.; Seung, H. S. (2001). Permitted and Forbidden Sets in Symmetric Threshold-Linear Networks. NIPS 2001. ↩
Yann LeCun; Leon Bottou; Genevieve B. Orr; Klaus-Robert Müller (1998). "Efficient BackProp" (PDF). In G. Orr; K. Müller (eds.). Neural Networks: Tricks of the Trade. Springer. /wiki/Yann_LeCun ↩
"PyTorch Leaky ReLU docs". https://pytorch.org/docs/stable/generated/torch.nn.LeakyReLU.html ↩
"TensorFlow Leaky ReLU docs". https://www.tensorflow.org/api_docs/python/tf/keras/layers/LeakyReLU ↩
He, Kaiming; Zhang, Xiangyu; Ren, Shaoqing; Sun, Jian (2015). "Delving Deep into Rectifiers: Surpassing Human-Level Performance on Image Net Classification". arXiv:1502.01852 [cs.CV]. /wiki/ArXiv_(identifier) ↩
Shang, Wenling; Sohn, Kihyuk; Almeida, Diogo; Lee, Honglak (2016-06-11). "Understanding and Improving Convolutional Neural Networks via Concatenated Rectified Linear Units". Proceedings of the 33rd International Conference on Machine Learning. PMLR: 2217–2225. arXiv:1603.05201. https://proceedings.mlr.press/v48/shang16.html ↩
Çatalbaş, Burak; Morgül, Ömer (16 August 2023). "Deep learning with ExtendeD Exponential Linear Unit (DELU)". Neural Computing and Applications. 35 (30): 22705–22724. Retrieved 20 April 2025. https://link.springer.com/article/10.1007/s00521-023-08932-z ↩
Hendrycks, Dan; Gimpel, Kevin (2016). "Gaussian Error Linear Units (GELUs)". arXiv:1606.08415 [cs.LG]. /wiki/ArXiv_(identifier) ↩
Diganta Misra (23 Aug 2019), Mish: A Self Regularized Non-Monotonic Activation Function (PDF), arXiv:1908.08681v1, retrieved 26 March 2022. https://www.bmvc2020-conference.com/assets/papers/0928.pdf ↩
Dugas, Charles; Bengio, Yoshua; Bélisle, François; Nadeau, Claude; Garcia, René (2000-01-01). "Incorporating second-order functional knowledge for better option pricing" (PDF). Proceedings of the 13th International Conference on Neural Information Processing Systems (NIPS'00). MIT Press: 451–457. Since the sigmoid h has a positive first derivative, its primitive, which we call softplus, is convex. http://papers.nips.cc/paper/1920-incorporating-second-order-functional-knowledge-for-better-option-pricing.pdf ↩
"Smooth Rectifier Linear Unit (SmoothReLU) Forward Layer". Developer Guide for Intel Data Analytics Acceleration Library. 2017. Retrieved 2018-12-04. https://software.intel.com/sites/products/documentation/doclib/daal/daal-user-and-reference-guides/daal_prog_guide/GUID-FAC73B9B-A597-4F7D-A5C4-46707E4A92A0.htm ↩
Clevert, Djork-Arné; Unterthiner, Thomas; Hochreiter, Sepp (2015). "Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs)". arXiv:1511.07289 [cs.LG]. /wiki/ArXiv_(identifier) ↩
Shaw, Sweta (2020-05-10). "Activation Functions Compared with Experiments". W&B. Retrieved 2022-07-11. https://wandb.ai/shweta/Activation%20Functions/reports/Activation-Functions-Compared-with-Experiments--VmlldzoxMDQwOTQ ↩
Barron, Jonathan T. (22 December 2021). "Squareplus: A Softplus-Like Algebraic Rectifier". arXiv:2112.11687 [cs.NE]. /wiki/ArXiv_(identifier) ↩