Activation Functions › Activation Functions

Michael BrenndoerferApril 21, 20254 min read
Language AI HandbookAll chapters
Part 10 of 67Neural Network Foundations
Chapter 62Activation Functions › Activation Functions
Reading section 1 of 16 · Activation Functions · 4 minSection 1 of 16 · 4 min

Book contents

Section 1 of 16 · 4 min read

Activation Functions › Activation FunctionsOne section · Sections in this chapter1 / 16 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

In the previous chapter on Linear Classifiers, we saw how a network layer computes a weighted sum of its inputs and passes the result through a softmax function to produce class probabilities. That operation is inherently linear: no matter how many such layers you stack, the composition of linear functions is still a linear function. A 100-layer network without anything nonlinear between the layers is mathematically identical to a single matrix multiplication. Activation functions break this constraint. They are the nonlinear gates placed after each linear transformation, and without them deep networks would have no more expressive power than a single-layer perceptron.

To appreciate why this matters, consider what a linear layer does. A linear transformation maps the input space to an output space through rotation, scaling, and reflection. You can stack as many of these transformations as you like, but the final result is still just another rotation, scaling, and reflection of the original input. There is no way to separate points that require a curved boundary, no way to model interactions between features that are not already captured by a single weighted sum. The moment you insert a nonlinear activation function between two linear layers, everything changes. Now the network can represent curved decision boundaries, and as you add more layers with more nonlinear activations, the representable function class grows exponentially.

Choosing the right activation function is not a cosmetic decision. The function you pick determines how gradients flow backward through the network during training, how quickly weights converge, whether certain neurons become permanently inactive, and how the network behaves in deep architectures. This chapter covers every major activation function used in modern neural networks: from the classical sigmoid and tanh through ReLU and its variants, through the exponential families ELU and SELU, all the way to the smooth modern functions like GELU, Swish, and Mish that power today's language models.

What is an Activation Function?

An activation function ff is a nonlinear function applied element-wise to the pre-activation value z=wTx+bz = \mathbf{w}^T \mathbf{x} + b of a neuron. The neuron's output is a=f(z)a = f(z). Without nonlinearity, stacking layers adds no representational power. The universal approximation theorem states that a neural network with a single hidden layer and a sufficiently large number of neurons using a nonlinear activation can approximate any continuous function to arbitrary precision on a compact domain.