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
SAME
padding, 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
VALID
padding, 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]))