Similarity between bordermode and zero padding in Keras
-
16-10-2019 - |
Question
In Keras, the border_mode = 'valid'
doesn't zero pad the input. Thus, we subsequently get an output feature map that is not the same size as the input. Likewise, setting border_mode = 'same'
gives output feature maps as the input. My question is if we set border_mode = 'same'
, should we also perform zero padding using the zero_padding
function?
Solution
I think I found the answer to this here https://github.com/fchollet/keras/issues/1984. If the stride is 1, border_mode = 'same' does the job of padding to ensure that the output feature maps are the same size as the input.
Licensed under: CC-BY-SA with attribution
Not affiliated with datascience.stackexchange