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" or "OFF", depending on input. This is similar to the behavior of 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.

Functions

In biologically inspired neural networks, the activation function is usually an abstraction representing the rate of action potential firing in the cell. 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, where is the slope. This activation function is linear and therefore cannot make decisions.
As biological neurons cannot lower their firing rate below zero, rectified linear activation functions are used:. They introduce a non-linearity at zero that can be used for decision making.
Neurons also cannot fire faster than a certain rate. Sigmoid activation functions use a second non-linearity for large inputs:. Because they are in the range between zero and one, sigmoid activations can be interpreted as probabilities. If a range from -1 to 1 is desired, the sigmoid can be scaled and shifted to yield the hyperbolic tangent activation function:.

Alternative structures

A special class of activation functions known as radial basis functions are used in RBF networks, which are extremely efficient as universal function approximators. These activation functions can take many forms, but they are usually found as one of three functions:
where is the vector representing the function center and and are parameters affecting the spread of the radius.
A computationally efficient Radial Basis Function has been proposed, called Square-law based RBF kernel which eliminates the exponential term as found in Gaussian RBF.
Support-vector machines can effectively utilize a class of activation functions that includes both sigmoids and RBFs. In this case, the input is transformed to reflect a decision boundary hyperplane based on a few training inputs called support-vectors. The activation function for the hidden layer of these machines is referred to as the inner product kernel,. The support-vectors are represented as the centers in RBFs with the kernel equal to the activation function, but they take a unique form in the perceptron as
where and must satisfy certain conditions for convergence. These machines can also accept arbitrary-order polynomial activation functions where

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. 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.
Aside from their empirical performance, activation functions also have different mathematical properties:
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 from the previous layer or layers:
NamePlotEquationDerivative RangeOrder of continuityMonotonicMonotonic derivativeApproximates identity near the origin
Identity
Binary step
Logistic
TanH
Rectified linear unit
Gaussian Error Linear Unit
SoftPlus
Exponential linear unit
Scaled exponential linear unit
with and
Leaky rectified linear unit
Parameteric rectified linear unit
ArcTan
ElliotSig Softsign
S-shaped rectified linear activation unit
are parameters.
Bent identity
Sigmoid Linear Unit
Sinusoid
Sinc
Gaussian
SQ-RBF

The following table lists activation functions that are not functions of a single fold from the previous layer or layers:
NameEquationDerivativesRangeOrder of continuity
Softmax for = 1, …,
Maxout

Here, is the Kronecker delta.