← Questions

2D convolution forward pass in NumPy, with parameter counts

0
TeslaCodingLast asked Dec 2025
  1. Given the input tensor shape, input channels, output channels, kernel size, stride and padding, how many parameters does a Conv2D layer have, with and without bias? What is the output shape?
  2. Implement the forward pass of a 2D convolution in NumPy, first with plain loops.
  3. Vectorize it (for example with an im2col-style reshaping) and check it against your loop version.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding