Activation function
In artificial neural networks, the activation function of a node defines the output of that node given an input or set of inputs. A standard integrated circuit can be seen as a digital network of activation functions that can be "ON" (1) or "OFF" (0), depending on input. This is similar to the linear perceptron in neural networks. However, only nonlinear activation functions allow such networks to compute nontrivial problems using only a small number of nodes, and such activation functions are called nonlinearities.[1]
Classification of activation functions[]
The most common activation functions can be divided in three categories: ridge functions, radial functions and fold functions.
Ridge activation functions[]
Ridge functions are multivariate functions acting on a linear combination of the input variables. Often used examples include:
- Linear activation: ,
- ReLU activation: ,
- Heaviside activation: ,
- Logistic activation: .
In biologically inspired neural networks, the activation function is usually an abstraction representing the rate of action potential firing in the cell.[2] In its simplest form, this function is binary—that is, either the neuron is firing or not. The function looks like , where is the Heaviside step function.
A line of positive slope may be used to reflect the increase in firing rate that occurs as input current increases. Such a function would be of the form .
Neurons also cannot fire faster than a certain rate, motivating sigmoid activation functions whose range is a finite interval.
Radial activation functions[]
A special class of activation functions known as radial basis functions (RBFs) are used in RBF networks, which are extremely efficient as universal function approximators. These activation functions can take many forms such as:
- Gaussian:
- Multiquadratics:
where is the vector representing the function center and and are parameters affecting the spread of the radius.
Folding activation functions[]
Folding activation functions are extensively used in the pooling layers in convolutional neural networks, and in output layers of multiclass classification networks. These activations perform aggregation over the inputs, such as taking the mean, minimum or maximum. In multiclass classification the softmax activation is often used.
Comparison of activation functions[]
There are numerous activation functions. Hinton et al.'s seminal 2012 paper on automatic speech recognition uses a logistic sigmoid activation function.[3] The seminal 2012 AlexNet computer vision architecture uses the ReLU activation function, as did the seminal 2015 computer vision architecture ResNet. The seminal 2018 language processing model BERT uses a smooth version of the ReLU, the GELU.[4]
Aside from their empirical performance, activation functions also have different mathematical properties:
- Nonlinear
- When the activation function is non-linear, then a two-layer neural network can be proven to be a universal function approximator.[5] This is known as the Universal Approximation Theorem. The identity activation function does not satisfy this property. When multiple layers use the identity activation function, the entire network is equivalent to a single-layer model.
- Range
- When the range of the activation function is finite, gradient-based training methods tend to be more stable, because pattern presentations significantly affect only limited weights. When the range is infinite, training is generally more efficient because pattern presentations significantly affect most of the weights. In the latter case, smaller learning rates are typically necessary.[citation needed]
- Continuously differentiable
- This property is desirable (ReLU is not continuously differentiable and has some issues with gradient-based optimization, but it is still possible) for enabling gradient-based optimization methods. The binary step activation function is not differentiable at 0, and it differentiates to 0 for all other values, so gradient-based methods can make no progress with it.[6]
Sign equivalence to identity function[]
Two real valued functions f and g are said to be sign equivalent if [7] for all values of z in the domain. Where sign is the signum function. Activation functions like tanh, Leaky ReLU, GELU, ELU, Swish and Mish are sign equivalent to the identity function and cannot learn the XOR function with a single neuron.[8] The output of a single neuron or its activation is , where g is the activation function. The decision boundary for a single neuron is the set of points that elicit an output of zero. Thus the decision boundary for a neuron using any of the activation functions sign equivalent to the identity function is a single hyperplane. However oscillatory activation functions can have many zeros and hence a single neuron can have multiple hyperplanes as part of its decision boundary. Although multilayer networks are needed to achieve nonlinear decision boundaries, the use of oscillatory activation functions allows even single neurons to exhibit nonlinear decision boundaries.[7]
These properties do not decisively influence performance, nor are they the only mathematical properties that may be useful. For instance, the strictly positive range of the softplus makes it suitable for predicting variances in variational autoencoders.
The following table compares the properties of several activation functions that are functions of one fold x from the previous layer or layers:
Name | Plot | Function, | Derivative of , | Range | Order of continuity |
---|---|---|---|---|---|
Identity | |||||
Binary step | |||||
Logistic, sigmoid, or soft step | [1] | ||||
Hyperbolic tangent (tanh) | |||||
Rectified linear unit (ReLU)[9] | |||||
Gaussian Error Linear Unit (GELU)[4] | |||||
Softplus[10] | |||||
Exponential linear unit (ELU)[11] |
|
||||
Scaled exponential linear unit (SELU)[12] |
|
||||
Leaky rectified linear unit (Leaky ReLU)[13] | |||||
Parameteric rectified linear unit (PReLU)[14] |
|
[2] | |||
Sigmoid linear unit (SiLU,[4] Sigmoid shrinkage,[15] SiL,[16] or Swish-1[17]) | |||||
Mish [18] | |||||
Gaussian | |||||
Growing Cosine Unit (GCU)[7] |
- ^ Here, is the logistic function.
- ^ for the range to hold true.
The following table lists activation functions that are not functions of a single fold x from the previous layer or layers:
Name | Equation, | Derivatives, | Range | Order of continuity |
---|---|---|---|---|
Softmax | for i = 1, …, J | [3][4] | ||
Maxout[19] |
- ^ Here, is the Kronecker delta.
- ^ For instance, could be iterating through the number of kernels of the previous neural network layer while iterates through the number of kernels of the current layer.
See also[]
References[]
- ^ Hinkelmann, Knut. "Neural Networks, p. 7" (PDF). University of Applied Sciences Northwestern Switzerland.
- ^ Hodgkin, A. L.; Huxley, A. F. (1952-08-28). "A quantitative description of membrane current and its application to conduction and excitation in nerve". The Journal of Physiology. 117 (4): 500–544. doi:10.1113/jphysiol.1952.sp004764. PMC 1392413. PMID 12991237.
- ^ Hinton, Geoffrey; Deng, Li; Deng, Li; Yu, Dong; Dahl, George; Mohamed, Abdel-rahman; Jaitly, Navdeep; Senior, Andrew; Vanhoucke, Vincent; Nguyen, Patrick; Sainath, Tara; Kingsbury, Brian (2012). "Deep Neural Networks for Acoustic Modeling in Speech Recognition". IEEE Signal Processing Magazine. 29 (6): 82–97. doi:10.1109/MSP.2012.2205597. S2CID 206485943.
- ^ Jump up to: a b c Hendrycks, Dan; Gimpel, Kevin (2016). "Gaussian Error Linear Units (GELUs)". arXiv:1606.08415 [cs.LG].
- ^ Cybenko, G. (December 1989). "Approximation by superpositions of a sigmoidal function". Mathematics of Control, Signals, and Systems. 2 (4): 303–314. doi:10.1007/BF02551274. ISSN 0932-4194. S2CID 3958369.
- ^ Snyman, Jan (3 March 2005). Practical Mathematical Optimization: An Introduction to Basic Optimization Theory and Classical and New Gradient-Based Algorithms. Springer Science & Business Media. ISBN 978-0-387-24348-1.
- ^ Jump up to: a b c Noel, Mathew Mithra; L, Arunkumar; Trivedi, Advait; Dutta, Praneet (2021-08-29). "Growing Cosine Unit: A Novel Oscillatory Activation Function That Can Speedup Training and Reduce Parameters in Convolutional Neural Networks". arXiv:2108.12943 [cs.LG].
- ^ , Wikipedia, 2021-09-05, retrieved 2021-09-06
- ^ Nair, Vinod; Hinton, Geoffrey E. (2010), "Rectified Linear Units Improve Restricted Boltzmann Machines", 27th International Conference on International Conference on Machine Learning, ICML'10, USA: Omnipress, pp. 807–814, ISBN 9781605589077
- ^ Glorot, Xavier; Bordes, Antoine; Bengio, Yoshua (2011). "Deep sparse rectifier neural networks" (PDF). International Conference on Artificial Intelligence and Statistics.
- ^ Clevert, Djork-Arné; Unterthiner, Thomas; Hochreiter, Sepp (2015-11-23). "Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs)". arXiv:1511.07289 [cs.LG].
- ^ Klambauer, Günter; Unterthiner, Thomas; Mayr, Andreas; Hochreiter, Sepp (2017-06-08). "Self-Normalizing Neural Networks". Advances in Neural Information Processing Systems. 30 (2017). arXiv:1706.02515. Bibcode:2017arXiv170602515K.
- ^ Maas, Andrew L.; Hannun, Awni Y.; Ng, Andrew Y. (June 2013). "Rectifier nonlinearities improve neural network acoustic models". Proc. ICML. 30 (1). S2CID 16489696.
- ^ He, Kaiming; Zhang, Xiangyu; Ren, Shaoqing; Sun, Jian (2015-02-06). "Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification". arXiv:1502.01852 [cs.CV].
- ^ Atto, Abdourrahmane M.; Pastor, Dominique; Mercier, Grégoire (2008), "Smooth sigmoid wavelet shrinkage for non-parametric estimation" (PDF), , doi:10.1109/ICASSP.2008.4518347, S2CID 9959057
- ^ Elfwing, Stefan; Uchibe, Eiji; Doya, Kenji (2018). "Sigmoid-Weighted Linear Units for Neural Network Function Approximation in Reinforcement Learning". Neural Networks. 107: 3–11. arXiv:1702.03118. doi:10.1016/j.neunet.2017.12.012. PMID 29395652. S2CID 6940861.
- ^ Ramachandran, Prajit; Zoph, Barret; Le, Quoc V (2017). "Searching for Activation Functions". arXiv:1710.05941 [cs.NE].
- ^ Misra, Diganta (2020-08-13). "Mish: A Self Regularized Non-Monotonic Activation Function". arXiv:1908.08681 [cs.LG].
- ^ Goodfellow, Ian J.; Warde-Farley, David; Mirza, Mehdi; Courville, Aaron; Bengio, Yoshua (2013). "Maxout Networks". JMLR Workshop and Conference Proceedings. 28 (3): 1319–1327. arXiv:1302.4389. Bibcode:2013arXiv1302.4389G.
- Artificial neural networks