0
0
PyTorchml~5 mins

nn.Conv2d layers in PyTorch - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does nn.Conv2d layer do in a neural network?
It applies a set of filters (kernels) to 2D input data (like images) to extract features such as edges or textures by sliding the filters over the input.
Click to reveal answer
beginner
What are the main parameters of nn.Conv2d?
The main parameters are: in_channels (input depth), out_channels (number of filters), kernel_size (filter size), stride (step size for sliding), padding (border added), and dilation (spacing inside the kernel).
Click to reveal answer
intermediate
How does padding affect the output size of nn.Conv2d?
Padding adds pixels around the input edges, allowing the filter to cover border areas. This can keep the output size the same as input or control shrinking.
Click to reveal answer
intermediate
What is the effect of stride in nn.Conv2d?
Stride controls how far the filter moves each step. A stride of 1 moves one pixel at a time, producing larger outputs. Larger strides skip pixels, reducing output size.
Click to reveal answer
beginner
Why do we use multiple filters (out_channels) in nn.Conv2d?
Multiple filters let the network learn different features from the input, like edges, colors, or shapes, improving the model's ability to understand complex patterns.
Click to reveal answer
What does the kernel_size parameter in nn.Conv2d specify?
AThe number of filters used
BThe size of the filter applied to the input
CThe step size of the filter movement
DThe amount of padding added
If stride is set to 2 in nn.Conv2d, what happens to the output size compared to stride 1?
AOutput size becomes zero
BOutput size doubles
COutput size stays the same
DOutput size halves approximately
What is the role of padding in nn.Conv2d?
ATo add borders so output size can be controlled
BTo speed up training
CTo change the input channels
DTo increase the number of filters
What does out_channels parameter control in nn.Conv2d?
ANumber of filters applied
BNumber of input channels
CSize of the input image
DStride length
Which of these is NOT a typical use of nn.Conv2d?
AExtracting image features
BReducing image size
CClassifying text documents directly
DDetecting edges in images
Explain how the parameters kernel_size, stride, and padding affect the output size of an nn.Conv2d layer.
Think about how the filter moves and covers the input image.
You got /4 concepts.
    Describe why multiple filters (out_channels) are used in nn.Conv2d and how they help the model learn.
    Imagine looking at an image with different colored glasses to see different details.
    You got /4 concepts.