Stacking linear maps still gives one linear map
Suppose a row of inputs passes through two weight matrices. Matrix multiplication is associative, so
We could multiply the two weight matrices in advance and replace the entire stack with one matrix. More linear layers change the calculation's organization, but not the kind of function it can express.
Put a bend between the layers
ReLU acts on each coordinate separately:
It leaves positive values unchanged and sends negative values to zero. The example from the animation is
Now the next matrix receives an input whose form depends on which coordinates were positive. The whole calculation can bend rather than acting like one fixed linear transformation everywhere.
The pattern in a dense network
A standard layer forms weighted sums, adds biases, and applies an activation:
Another layer can combine those activations. Each neuron computes a weighted sum; the activation changes how successive layers compose. Biases shift where activations turn on.
See why ReLU is nonlinear
Take and . ReLU of their sum is zero, but the sum of their separate ReLUs is one:
The additivity rule fails. This is exactly why a ReLU between matrices prevents the general collapse into one linear map.
