A small rule after the sum
Our neuron computed 1.5. Before passing this number on, it applies one more fixed rule. A rule like that is called an activation function.
The most popular one is delightfully simple: if the number is negative, make it zero. Otherwise leave it as it is. This rule is called ReLU, short for Rectified Linear Unit, but you don't need to remember the name.
| Sum before the rule | Output after ReLU |
|---|---|
| −3 | 0 |
| −0.5 | 0 |
| 0 | 0 |
| 1.5 | 1.5 |
| 4 | 4 |
What comes out is called the activation. So the activation function is the rule, the activation is its result.
For our neuron with sum 1.5, it stays 1.5. If we set the weights so that −2 comes out, the neuron passes on 0. In the experiment you can watch exactly this transition.
Why not just pass everything through?
Now it gets interesting. Picture two calculation steps in a row: first “times 2”, then “times 3”. Together that is simply “times 6”. Two steps, but not one bit more capability than one.
And with shifts? “Times 2, plus 1” followed by “times 3, plus 4” adds up to “times 6, plus 7”. Again, two stages shrink into one.
That holds for any number of stages. Without an extra rule, a network with a hundred layers could do no more than one with a single layer. If you plot such calculations, you always get a straight line. And straight lines alone cannot describe the crooked, twisty world of language.
A small footnote for sticklers: with a shift, such calculations are strictly called affine in mathematics, not linear. With neural networks, people usually say “linear” anyway.
A kink changes what is possible
ReLU is not a straight line. Left of zero it stays flat at zero, to the right it rises, and in between there is a kink. The technical term: nonlinear.
And that kink is worth its weight in gold. Neurons with kinks at different places can be combined into almost any shape, like a wire you bend at many points until it traces any curve. That way a network can, for example, react to something only once a certain value is exceeded.
A single ReLU neuron obviously can't do everything. The power comes from teamwork: many neurons, each with its own weights and its own kink. In the next chapter we build such a team.
The short notation
is again the sum before the activation function, the result after it. Both are just names, not new parameters.
Read the formula: the activation a is ReLU of z, that is, the larger of the two numbers 0 and z. max stands for “maximum”, the larger value. ReLU and max are two names for the same rule here.
“The neuron fires” – really?
You often read that a neuron “fires” or is “active”. That sounds livelier than it is. A ReLU output of 0 simply means: this number is zero right now. An output of 3 is not a thought and not a decision; it is a three.
“Nonlinear” isn't magic either. It just means: not a straight line. In the experiment you can check the rule point by point.
There are other rules too
ReLU is not the only activation function. Some bend negative numbers down gently instead of cutting them hard to zero. GELU and SiLU, for example, will show up later in modern models. For getting started, ReLU is perfect because you can work out every output in your head.
By the way, not every layer needs the same rule. The last layer of a network often has to be allowed to output any number, negative ones included, so the rule is simply left out there. And if probabilities are supposed to come out at the end, that takes a completely different conversion. You will meet it in the language part.
Guess first, then try
Before the experiment, think: what happens when you increase the bias? It can push a negative sum into positive territory. Then the neuron suddenly passes something on where it used to give zero. The rule itself has not changed, only what goes into it.
Key points
- An activation function is a fixed rule after the sum. With ReLU, everything negative becomes zero.
- Without such kinks, any number of layers collapses into a single one.
- With kinks, many neurons together can reproduce crooked relationships, the foundation for everything that follows.