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 ?
Deep learning, Multilayer perceptrons
Level L2 Elementary. Length Short. Nature Mat Mathematical.
What's being asked
Whether you can run a forward pass by hand: weighted sum, activation, next layer, then the loss.
Key idea
A forward pass computes each layer in order. For each unit, form the weighted sum plus bias (the pre-activation ), apply the activation, and feed the results to the next layer. ReLU keeps positive values and turns negative ones into 0.
Steps
- Hidden unit 1, pre-activation: . After ReLU, .
- Hidden unit 2, pre-activation: . After ReLU, .
- Output: .
- Loss with : .
- Note what ReLU did: hidden unit 2 is switched off for this input, so its output weight 3 had no effect on the prediction.
Common mistakes
- Applying ReLU to the output. Here the output is linear, so 3 stays 3.
- Forgetting the bias terms ( in the hidden units and at the output).
- Keeping the negative value for instead of replacing it by 0.
How long your answer should be
About 2 minutes: five short lines of arithmetic.
Read this
Previous in Deep learning: 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 ?
Next in Deep learning: How do you derive the gradient of the softmax cross-entropy loss with respect to the logits?