Explain why stacked linear layers collapse
Read a complete operation before typing its result. · 177 words
A neural network's dense layer can compute y = Wx + b, where x holds inputs, W holds weights, and b is an offset. This is an affine transformation, often called a linear layer in software. Consider a bookstore demand model with inputs x1 for browsers and x2 for purchases. Its first layer forms h = [2x1+x2, x1-x2], and its second forms y = 3h1-2h2. Substitution gives y = 3(2x1+x2)-2(x1-x2) = 4x1+5x2. In general, y = W2(W1x+b1)+b2 = (W2W1)x+(W2b1+b2). This is exactly one linear layer: the stack adds notation, not representational power.
This matters when a system must bend a decision boundary, the rule separating two classes. A museum ticket model that accepts requests with a positive linear score can separate data with one straight line. An activation, an operation between layers, such as ReLU, max(0,z), can form bent or piecewise-linear boundaries that one line cannot. ReLU is nonlinear because its output rule changes at zero. Thus 'collapse' does not mean the layers stop working. It means several linear transformations can be replaced by one equivalent transformation.
Check your recall
In the bookstore stack, h1=2x1+x2, h2=x1-x2, and y=3h1-2h2. What single linear expression does y equal?
Check your answer
Substitution gives y = 3(2x1+x2)-2(x1-x2) = 4x1+5x2.
Sources and credits
Original KeyTouch lesson. Background reading · Google · Neural networks.