Learn Before
Example
Example of Preserving Dimensionality with Padding
Deep learning frameworks allow us to programmatically apply padding to convolutional layers to manage feature map sizes. For example, applying a kernel with 1 pixel of padding on all sides to an input preserves the input's dimensionality, resulting in an output. Similarly, if the kernel is non-square, such as , we can supply a tuple to set different padding values for the height and width (e.g., padding of 2 for height and 1 for width) to maintain the original spatial dimensions.
0
1
Updated 2026-06-21
Tags
D2L
Dive into Deep Learning @ D2L