Deep learning builds enormously capable systems from one simple unit, loosely inspired by biological neurons: a weighted sum followed by a nonlinearity. Everything from image classifiers to language models is made of millions or billions of these.
We will compute a weighted sum with ReLU, try other activations, and finish with why nonlinearity matters.
Step 1: Weighted sum and ReLU
An artificial neuron computes a weighted sum of its inputs plus a bias, then applies an activation function φ:
The default activation in hidden layers is the rectified linear unit, ReLU(z) = max(0, z): it passes positive sums through unchanged and outputs exactly 0 for every negative input. A neuron with weights (0.5, 0.5), bias −1 and input (−1, 3) has sum −0.5 + 1.5 − 1 = 0, so it outputs 0.
Step 2: Other activations
Smooth alternatives are also used. The sigmoid 1/(1 + e−z) runs from 0 to 1 with σ(0) = ½. Tanh, (eᶻ − e−z)/(eᶻ + e−z), has the same S shape but runs from −1 to 1, centered at 0 with tanh(0) = 0, and is odd: tanh(−z) = −tanh(z). GELU, approximately z·Φ(z), is a smooth version of ReLU used in many transformers: near 0 for very negative inputs, near z for large positive ones.
Step 3: Why nonlinearity
Without activation functions, each layer is an affine map, and a composition of affine maps is affine: a network of 10 such layers is equivalent to a single linear layer. The nonlinearity is what lets depth add expressive power. ReLU replaced sigmoids in hidden layers because sigmoid slopes are at most ¼, which shrinks signals through many layers, while ReLU's slope is exactly 1 for active units. Its weakness: a unit whose input is negative for every example outputs zero, gets no gradient and stops learning, a dead ReLU.