Formula

Computation of Convolution Output Size

When applying a two-dimensional cross-correlation without padding, the resulting output tensor is dimensionally smaller than the input. Since the kernel must fit completely within the boundaries of the input tensor, an input of size nh×nwn_\textrm{h} \times n_\textrm{w} convolved with a kernel of size kh×kwk_\textrm{h} \times k_\textrm{w} will yield an output shape calculated by the formula: (nhkh+1)×(nwkw+1)(n_\textrm{h}-k_\textrm{h}+1) \times (n_\textrm{w}-k_\textrm{w}+1).

0

1

Updated 2026-05-09

Tags

Data Science

D2L

Dive into Deep Learning @ D2L