Tensorflow中padding的两种类型SAME和VALID
2017-06-08 08:46
471 查看
按照下面的解释,“SAME”用的比较多。same的含义是:长度除以步长向上取整。
For the
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]))
http://blog.csdn.net/jasonzzj/article/details/53930074
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:
The TensorFlow Convolution example gives an overview about the difference
between
For the
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
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]))
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]))
http://blog.csdn.net/jasonzzj/article/details/53930074
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:
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 = 13 Filter width = 6 Stride = 5 Notes: "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). |
between
SAMEand
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]))
相关文章推荐
- Tensorflow中padding的两种类型SAME和VALID
- Tensorflow中padding的两种类型SAME和VALID
- Tensorflow中padding的两种类型SAME和VALID
- Tensorflow中padding的两种类型SAME和VALID
- Tensorflow中padding的两种类型SAME和VALID
- TensorFlow中CNN的两种padding方式“SAME”和“VALID”
- TensorFlow中CNN的两种padding方式“SAME”和“VALID”
- TensorFlow中CNN的两种padding方式“SAME”和“VALID”
- TensorFlow中CNN的两种padding方式“SAME”和“VALID”
- Tensorflow里的padding操作(VALID和SAME两种)
- CNN中两种padding方式VALID和SAME
- TensorFlow中padding的 'SAME' 和 'VALID' 参数
- tensorflow:SAME VALID padding
- tensorflow中padding的两种类型对比
- tensorflow_conv2d_max_pool卷积池化padding参数为SAME和VALID的区别
- [AI, 深度学习] tensorflow中padding="SAME"和"VALID"的区别
- tensorflow 中的padding方式“SAME”和“VALID”
- tensorflow中padding方式理解:same与valide
- tensorflow 中 VALID 和 SAME
- padding参数为SAME和VALID的区别