A convolutional layer takes a input and applies 16 filters of size with stride 1 and padding 2. What is the output shape, and how many learnable parameters does the layer have? What changes if the stride is 2 and the padding is 0?
Deep learning, Convolutional networks
Level L2 Elementary. Length Short. Nature Mat Mathematical.
What's being asked
Whether you know the output-size formula, and that each filter spans the full input depth.
Key idea
For input width , kernel size , padding and stride , the output width is , where rounds down. The parameter count is , for input channels and filters. It does not depend on stride, padding or input width.
Steps
- Output size: . So the output is , because the depth equals the number of filters.
- Parameters: each filter has weights plus 1 bias, so .
- Stride 2, padding 0: , so the output is . There are still parameters.
- Optional contrast: a fully connected layer from inputs to outputs needs weights. Convolutions are cheap because of weight sharing: the same filter is reused at every position.
Common mistakes
- Forgetting the input depth, i.e. counting .
- Forgetting the biases (one per filter).
- Thinking stride or padding changes the parameter count, or not rounding down when is not an integer.
How long your answer should be
4–5 lines of arithmetic; under 2 minutes.
Last checked on 4 December 2026.
Read this
Previous in Deep learning: Let , where the inputs and the parameters are all scalars and is the natural log. What is the computational graph with intermediate nodes, and how do you use backpropagation on it to compute ?
Next in Deep learning: What is the receptive field of a unit after three stacked convolutions with stride 1, and how does their total parameter count compare with a single convolution (both with input and output channels, ignoring biases)?