A multilayer perceptron takes 10-dimensional inputs, passes them through two hidden layers of widths 32 and 16 (each with biases), and outputs 4 class scores (logits). How many learnable parameters does it have?
Deep learning, Multilayer perceptrons
Level L1 Beginner. Length One-liner. Nature Mat Mathematical.
What's being asked
Whether you can count weights and biases in a fully connected network from layer widths.
Key idea
A dense layer from inputs to outputs with biases has parameters; summing across the three layers gives .
Steps
- Apply per layer (one weight per input–output pair plus one bias per output unit; activations add zero parameters).
- Compute each layer: layer 1 () has , layer 2 () has , and the output layer () has .
- Sum the three layers: learnable parameters.
Common mistakes
- Forgetting the bias vector in one or more layers.
- Thinking ReLU or softmax adds extra learnable parameters.
How long your answer should be
One sentence showing the sum across layers.
Read this
Previous in Deep learning: Why does an ordinary autoencoder need a bottleneck smaller than the input dimension, or an explicit regulariser?
Next in Deep learning: What goes wrong if you initialise every weight in a multi-layer perceptron to zero (or to the same non-zero constant )?