Example

Example of Two-Dimensional Cross-Correlation with Padding

As an example of padding in a convolutional layer, consider a 3imes33 imes 3 input tensor padded with zero values to increase its size to 5imes55 imes 5. If we apply a two-dimensional cross-correlation using a 2imes22 imes 2 kernel on this padded input, the resulting output will be a 4imes44 imes 4 matrix. The added zero pixels do not change the sum of the products when the convolution window covers them.

Image 0

0

2

Updated 2026-05-12

Tags

Data Science

D2L

Dive into Deep Learning @ D2L