SAME means that the output feature map has the same spatial dimensions as the input feature map. Zero padding is introduced to make the shapes match as needed, equally on every side of the input map.
VALID means no padding.
Padding could be used in convolution and pooling operations.
Here, take pooling for example:
| If you like ascii art:
In this example:
Notes:
|
The TensorFlow Convolution example gives an overview about the difference between SAME and VALID :
-
For the
SAMEpadding, the output height and width are computed as:out_height = ceil(float(in_height) / float(strides[1]))
out_width = ceil(float(in_width) / float(strides[2]))
And
-
For the
VALIDpadding, the output height and width are computed as:out_height = ceil(float(in_height - filter_height + 1) / float(strides1))
out_width = ceil(float(in_width - filter_width + 1) / float(strides[2]))

本文详细解释了在卷积神经网络中SAME与VALID两种填充方式的区别。SAME填充确保输出特征图与输入特征图尺寸相同,通过在输入周围添加零填充实现;而VALID则不使用填充。文章还提供了具体示例来帮助理解这两种填充方式。
495





