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.

Padding could be used in convolution and pooling operations.
Here, take pooling for example:

 down vote If you like ascii art: "VALID" = without padding:  inputs: 1 2 3 4 5 6 7 8 9 10 11 (12 13) |________________| dropped |_________________| "SAME" = with zero padding:  pad| |pad inputs: 0 |1 2 3 4 5 6 7 8 9 10 11 12 13|0 0 |________________| |_________________| |________________| In this example: Input width = 13Filter width = 6Stride = 5Notes: "VALID" only ever drops the right-most columns (or bottom-most rows)."SAME" tries to pad evenly left and right, but if the amount of columns to be added is odd, it will add the extra column to the right, as is the case in this example (the same logic applies vertically: there may be an extra row of zeros at the bottom).

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]))

03-26 7178

09-20 6190
04-04 660
08-06 2005
01-02 1081
01-31 1万+
08-23 2117
07-02 1万+
04-21 590
07-12 2645
08-02 1540