Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
padding effect parameter is determined when performing the convolution operation or a pool, whether the input edge up image matrix 0, 'SAME' is zero padding, 'the VALID' is not complementary, since the filter is not possible during these operations the data in a certain direction just processed.
- VALID mode
|dropped
inputs: 1 2 3 4 5 6 7 8 9 10 11 (12 13)
|______________|
|_______________|
For VALID method, the output size is calculated as follows:
out_width = out_height = ⌈ (s_input – s_filter + 1)/ s_stride ⌉
Wherein, s_input is the size of the input, s_filter the size of the filter, s_stride in steps, ⌈⌉ is rounded up.
- SAME mode
|pading
inputs: 1 2 3 4 5 6 7 8 9 10 11 12 13 |0 0 0
|______________|
|______________|
|_________________|
For SAME, the output size is calculated as follows:
out_width = out_height = ⌈ s_input / s_stride ⌉
Wherein, s_input is the size of the input, s_stride in steps, ⌈⌉ is rounded up