A network has two layers with no activation function. Layer 1 is with , . Layer 2 is with , . What single layer does the same job, and does it agree with the two layers at ?
Deep learning, Neurons and activations
Level L2 Elementary. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can show the collapse of stacked affine layers with actual numbers, and say what a non-linearity changes.
Key idea
Substitute layer 1 into layer 2: . So and : depth without a non-linearity gives no extra power.
Steps
- This is the harder follow-up to `why-nonlinear-activations`, which comes first. Write the substitution: . This is again of the form .
- Compute . For example, the top-right entry is .
- Compute .
- Check with . Two layers: , then . One layer: . They agree.
- Consequence: the same collapse happens for any number of layers, . Putting a non-linearity such as between the layers breaks this, so depth can then add real power (for example, solving XOR).
Common mistakes
- Multiplying the matrices in the wrong order. The first layer acts first, so it is the right-most factor: , not .
- Forgetting that the bias of layer 1 is also transformed by : , not .
- Thinking that more layers always means a more powerful model. Without activations it does not.
How long your answer should be
Half a page, about 3 minutes.
Read this
Previous in Deep learning: A feature map goes through pooling with stride , giving a output. The gradient of the loss with respect to that output is . What is the gradient with respect to for max pooling and for average pooling?
Next in Deep learning: A tiny network has input , two hidden units with and , and a linear output . Here . Compute the hidden values, the output , and the squared error for the target ?