Lesson 3.4 · 6 min read · about 45 min to master at a very slow pace
Why Non-linearity Is Essential
Stacking layers without non-linear activations gives nothing new: any stack of linear layers collapses to a single linear layer. The algebra, a numerical check, and the consequence for XOR.
The collapse
Suppose both layers use the identity activation :
That is a single affine layer . Repeating the argument, any number of linear layers collapses to one. Its decision boundary is still a hyperplane, so it still can't solve XOR.
Numerical check
, , , .
- Collapsed: and , so .
- Check with : layer 1 gives ; layer 2 gives . The collapsed formula gives . ✓
What non-linearity buys
Put a non-linear between the layers and the composition no longer simplifies: each layer can bend and fold the space, which is how the hidden layer in the XOR network made the classes separable. Non-linear activations are what give depth its power.
Exam phrasing
"Without non-linear activations, stacked layers compose to a single affine map , so a deep linear network is no more expressive than one linear layer and cannot solve XOR."
Stuck? Common doubts
Questions real learners asked while studying this lesson. They stay closed so they don't spoil your own thinking: open only the ones you need.
First passSo is a linear activation ever useful?
Yes, at the output of a regression network, where you want an unbounded real number (Section 6). What you shouldn't do is use only linear activations in the hidden layers, because then the hidden layers add nothing.
First passDoes linear regression need a non-linear activation function?
No. Linear regression is one neuron with the identity activation: . That is exactly what it should be, because it models a straight-line (linear) relationship. Non-linear activations matter when you stack hidden layers: without them, the layers collapse into one linear map, as shown above.
Cheatsheet
Linear layers collapse
Check your understanding
Score 75% or more to master this lesson and earn XP. Answer first, then check.