A single-channel input is cross-correlated (no padding, stride 1, no bias) with a kernel , giving output . Given upstream loss gradient , what is , and how is computed in general?
Deep learning, Convolutional networks
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can derive convolution backward passes using the chain rule and evaluate the weight gradient numerically.
Key idea
In the forward pass (zero-indexed). By the chain rule, sums over all output positions , which is simply the cross-correlation of with .
Steps
- Write the forward relation (zero-indexed , ): .
- Apply the chain rule for , where . Notice this is the cross-correlation of by .
- Evaluate the four entries with : : ; : ; : ; : . Thus .
- Derive : each contributes to whenever and (so with and , where is the kernel width), giving — a full convolution (cross-correlation with a -flipped kernel , padded by ).
Common mistakes
- Rotating by when computing ; the weight gradient is a direct cross-correlation of with , whereas the input gradient rotates by .
- Missing the boundary zeros when stating the general formula for (it requires full padding of around ).
How long your answer should be
Half a page; 4 minutes.
Last checked on 4 December 2026.
Read this
Previous in Deep learning: What is a dilated (atrous) convolution with dilation factor ? For a 1-D input of length , what are the output length and the receptive field after two stacked convolutions with stride 1, no padding and dilations and , and why does exponential dilation () avoid the gridding problem?
Next in Deep learning: How does a transposed convolution upsample a feature map (give its output size formula for input size , kernel , stride and padding ), and why does it often create checkerboard artefacts when is not divisible by ?