From biology to arithmetic
A biological neuron receives signals through its dendrites, adds up the excitation in its cell body, and, if the total crosses a threshold, fires a signal down its axon to other neurons.
The artificial neuron keeps only the arithmetic of that story: weigh the inputs, sum them, squash the result. It's a loose inspiration, not a model of the brain, and modern networks owe far more to mathematics than to biology.
The math of one neuron
A neuron with inputs , weights and bias computes two things:
The pre-activation is a weighted sum: each weight says how much its input matters, and in which direction. The bias shifts the threshold. The activation function then turns into the neuron's output .
For example, with , and :
A neuron has weights , bias and a ReLU activation. What does it output for ?
The geometry: a line through the data
Here is the insight that makes neurons click. Suppose the neuron answers "class 1" when . Then the points where it is exactly undecided satisfy
In two dimensions that's the equation of a straight line. In three, it's a plane, and in general it's a hyperplane. This is the neuron's decision boundary, and its geometry is governed by the parameters:
- The weight vector is perpendicular to the boundary and points towards the positive side.
- The bias slides the boundary back and forth without rotating it.
- Scaling and together doesn't move the line, but it makes a sigmoid neuron more confident: its transition gets sharper.
Try it. Rotate the line with the weights, slide it with the bias, and separate the blue points from the gold ones.
Interactive lab
One neuron, one line
a = σ(z)output at origin: 0.62
Accuracy
17/24
Activation functions
Why not skip the activation and use directly? Because stacking linear layers gets you nowhere:
Any stack of linear layers collapses into a single linear layer. The nonlinearity is what lets depth add expressive power. Explore the classic choices, and watch their slopes, because backpropagation (next chamber) multiplies by exactly those slopes.
Interactive lab
Activation function explorer
z
1
f(z)
0.731
f′(z)
0.197
Squashes any number into (0, 1), which is handy for probabilities. But it saturates: for large |z| the derivative is nearly 0, and it never exceeds 0.25.
Explored 1/6
The sigmoid has an especially neat derivative, , which never exceeds . Hold on to that fact. It's the seed of the vanishing gradient problem.
Derive σ′(z) yourself (try it first!)
Write and apply the chain rule:
The second factor equals because .
The problem that froze a field: XOR
XOR ("exclusive or") outputs 1 when exactly one of its inputs is 1:
| XOR | ||
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Plot those four points and try to draw one straight line with both 1s on one side and both 0s on the other. You can't: the classes sit on opposite corners. XOR is not linearly separable, so no single neuron can compute it. Switch the lab above to XOR mode and see for yourself: 75% is the ceiling.
Key takeaways
- A neuron computes a weighted sum , then applies an activation .
- Its decision boundary is a hyperplane: sets the orientation, the offset.
- Nonlinear activations are essential; without them, depth collapses to a single linear map.
- A single neuron can only solve linearly separable problems. XOR is the classic counterexample.
Checkpoint
Prove it to the labyrinth
Answer every question to clear this chamber. First-try answers earn the most XP.
Why do neural networks need nonlinear activation functions?
What does the decision boundary of a single neuron look like in a 2D input space?
The sigmoid's derivative is . What is its maximum value?
End of the chamber
Clear this chamber
- Questions in this chamber (0/4 solved)Next unsolved
- Bonus: Draw the line (+40 XP)
- Bonus: Activation tour (+15 XP)