EasyDeepLearn

Why does stacking linear layers without nonlinearity collapse to a single linear layer?

easy

Answer

  • The composition of linear maps is a linear map: W2W_{2} (W1  x  +  b1)  +  b2  =  (W2  W1)(W_{1}\;x\; + \;b_{1})\; + \;b_{2}\; = \;(W_{2}\;W_{1}) x  +  (W2  b1  +  b2)x\; + \;(W_{2}\;b_{1}\; + \;b_{2}).
  • No matter how many layers you stack, the effective function is W x + b.
  • Non-linear activations (ReLU, GELU, tanh) break this and unlock representational power that grows with depth.
Check yourself — multiple choice
  • Stacked linear layers approximate any function
  • Linear composed with linear is still linear; nonlinearity gives depth its power
  • ReLU is a linear function
  • Bias terms alone break linearity

Composition of linear maps is linear — you need a nonlinearity between layers.

#fundamentals#activations

Practise Deep Learning

214 interview questions in this topic.

Related questions