Recall & Review
beginner
What is kernel size in a convolutional layer?
Kernel size is the size of the small window (filter) that slides over the input image or feature map to detect patterns. For example, a 3x3 kernel looks at 3 pixels wide and 3 pixels tall at a time.
Click to reveal answer
beginner
Explain stride in convolution.
Stride is how many pixels the kernel moves each time it slides over the input. A stride of 1 moves the kernel one pixel at a time, while a stride of 2 skips one pixel, making the output smaller.
Click to reveal answer
beginner
What does padding do in convolutional layers?
Padding adds extra pixels (usually zeros) around the input edges. This helps keep the output size the same as the input or controls how much the output shrinks after convolution.
Click to reveal answer
intermediate
How does increasing stride affect the output size?
Increasing stride makes the kernel jump further each step, so the output feature map becomes smaller because fewer positions are covered.
Click to reveal answer
intermediate
Why might you use padding='same' in PyTorch convolution?
Padding='same' adds just enough padding so the output size matches the input size, which is useful when you want to keep spatial dimensions unchanged through layers.
Click to reveal answer
What does a kernel size of (5,5) mean in a convolution?
✗ Incorrect
Kernel size defines the filter window size, so (5,5) means 5 pixels wide and 5 pixels tall.
If stride=2, how does the output size change compared to stride=1?
✗ Incorrect
A stride of 2 skips pixels, so the output size roughly halves compared to stride 1.
What is the main purpose of padding in convolution?
✗ Incorrect
Padding adds pixels (usually zeros) around the input edges to control output size.
Which PyTorch parameter controls how far the kernel moves each step?
✗ Incorrect
Stride controls the step size of the kernel movement.
What happens if you use no padding with a 3x3 kernel and stride 1 on a 28x28 input?
✗ Incorrect
Without padding, output size shrinks by kernel_size - 1, so 28 - 3 + 1 = 26.
Describe how kernel size, stride, and padding affect the output size of a convolutional layer.
Think about how the filter moves and how edges are handled.
You got /5 concepts.
Explain why padding might be important when stacking many convolutional layers.
Consider what happens to image size after many convolutions.
You got /4 concepts.