ArticleslgStudy

mathematics

Activation function

Activation function is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Activation function rather than just read about it. In short: In artificial neural networks, the activation function of a node is a function that calculates the output of the node based on its individual inputs and their weights. Nontrivial problems can be solved using only a few nodes if the activation function is nonlinear.

Activation function — main illustration
Activation function — illustration

Key takeaways

  • Activation function belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Activation function to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Activation function from memory before moving on to harder problems.

Reference excerpt

In artificial neural networks, the activation function of a node is a function that calculates the output of the node based on its individual inputs and their weights. Nontrivial problems can be solved using only a few nodes if the activation function is nonlinear. Modern activation functions include the logistic (sigmoid) function used in the 2012 speech recognition model developed by Hinton et al; the ReLU used in the 2012 AlexNet computer vision model and in the 2015 ResNet model; and the smooth version of the ReLU, the GELU, which was used in the 2018 BERT model.

Comparison of activation functions 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. 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. Continuously differentiable This property is desirable for enabling gradient-based optimization methods (ReLU is not continuously differentiable and has some issues with gradient-based optimization, but it is still possible). 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. 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.

Mathematical details The most common activation functions can be divided into three categories: ridge functions, radial functions and fold functions. An activation function f is saturating if lim|v|→∞|∇f(v)|=0. It is nonsaturating if lim|v|→∞|∇f(v)|≠0. Non-saturating activation functions, such as ReLU, may be better than saturating activation functions, because they are less likely to suffer from the vanishing gradient problem.

Ridge activation functions

Ridge functions are multivariate functions acting on a linear combination of the input variables. Often used examples include:

Linear activation: ϕ(𝐯)=a+𝐯′𝐛, ReLU activation: ϕ(𝐯)=max⁡(0,a+𝐯′𝐛), Heaviside activation: ϕ(𝐯)=1a+𝐯′𝐛>0, Logistic activation: ϕ(𝐯)=(1+exp⁡(−a−𝐯′𝐛))−1. 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. Neurons also cannot fire faster than a certain rate. This biological limitation motivates the use of sigmoid activation functions, whose output range is confined to a finite interval. The function looks like ϕ(𝐯)=U(a+𝐯′𝐛), where U is the Heaviside step function. If a line has a positive slope, on the other hand, it may reflect the increase in firing rate that occurs as input current increases. Such a function would be of the form ϕ(𝐯)=a+𝐯′𝐛.

Radial activation functions

A special class of activation functions known as radial basis functions (RBFs) are used in RBF networks. These activation functions can take many forms, but they are usually found as one of the following functions:

Gaussian: ϕ(𝐯)=exp⁡(−‖𝐯−𝐜‖22σ2) Multiquadratics: ϕ(𝐯)=‖𝐯−𝐜‖2+a2 Inverse multiquadratics: ϕ(𝐯)=(‖𝐯−𝐜‖2+a2)−12 Polyharmonic splines where 𝐜 is the vector representing the function center and a and σ are parameters affecting the spread of the radius.

Other examples Periodic functions can serve as activation functions. Usually the sinusoid is used, as any periodic function is decomposable into sinusoids by the Fourier transform. Quadratic activation maps x↦x2.

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.

Table of activation functions The following table compares the properties of several activation functions that are functions of one fold x from the previous layer or layers:

The following table lists activation functions that are not functions of a single fold x from the previous layer or layers:

^ Here, δij is the Kronecker delta. ^ For instance, j could be iterating through the number of kernels of the previous neural network layer while i iterates through the number of kernels of the current layer.

Quantum activation functions

In quantum neural networks programmed on gate-model quantum computers, based on quantum perceptrons instead of variational quantum circuits, the non-linearity of the activation function can be implemented with no need of measuring the output of each perceptron at each layer. The quantum properties loaded within the circuit such as superposition can be preserved by creating the Taylor series of the argument computed by the perceptron itself, with suitable quantum circuits computing the powers up to a wanted approximation degree. Because of the flexibility of such quantum circuits, they can be designed in order to approximate any arbitrary classical activation function.

See also Logistic function Rectifier (neural networks) Stability (learning theory) Softmax function

References

… excerpt ends here. Continue reading the full article.

Illustrations

Activation function: Logistic activation function
Logistic activation function
Activation function: Rectified linear unit and Gaussian error linear unit activation functions
Rectified linear unit and Gaussian error linear unit activation functions
Activation function illustration
Activation function illustration
Activation function illustration

Worked examples

Example 1 — a first encounter with Activation function

Start with the simplest possible case. Write down what Activation function claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Activation function before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Activation function ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Activation function

In research
Activation function appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Activation function in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Activation function is common in secondary-school and first-year university syllabi. It links to neighbouring topics Artificial neural networks, so understanding it makes those chapters shorter.
In everyday life
Look for Activation function outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Activation function” →

How to study Activation function in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Activation function means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Activation function out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Activation function in simple terms?

In artificial neural networks, the activation function of a node is a function that calculates the output of the node based on its individual inputs and their weights. Nontrivial problems can be solved using only a few nodes if the activation function is nonlinear.

Why does Activation function matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Activation function?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Activation function.

Tags

  • Artificial neural networks

Keep exploring