Padding的好处

    • It allows you to use a CONV layer without necessarily shrinking the height and width of the volumes. This is important for building deeper networks, since otherwise the height/width would shrink as you go to deeper layers. An important special case is the “same” convolution, in which the height/width is exactly preserved after one layer.

    保证了卷积层在训练的时候,高度和宽度都不会缩小,尤其是要保证same卷积的时候

    • It helps us keep more of the information at the border of an image. Without padding, very few values at the next layer would be affected by pixels as the edges of an image.

    保证了image边缘的信息(像素)不会被轻视。因为如果没有padding,越处于中间的像素就越会被filter给处理多次,越处于边缘的像素被filter处理的次数就越少