Full padding

While convolving a kernel generally decreases the output size with respect to the input size, sometimes the opposite is required. This can be achieved with proper zero padding:

For any \( i \) and \( k \), and for \( p = k - 1 \) and \( s = 1 \),

$$ \begin{equation*} \begin{split} o &= i + 2(k - 1) - (k - 1) \\ &= i + (k - 1). \end{split} \end{equation*} $$

This is sometimes referred to as full padding, because in this setting every possible partial or complete superimposition of the kernel on the input feature map is taken into account.