Keras has two border_mode for convolution2D, same and valid. Could anyone explain what "same" does or point out some documentation? I could not find any document on the net (except people asking that it be implemented in theano as well).
With border mode "valid" you get an output that is smaller than the input because the convolution is only computed where the input and the filter fully overlap.
With border mode "same" you get an output that is the "same" size as the input. That means that the filter has to go outside the bounds of the input by "filter size / 2" - the area outside of the input is normally padded with zeros.
Note that some libraries also support the border mode "full" where the filter goes even further outside the bounds of the input - up to "filter size - 1". This results in an output shape larger than the input.
There's a short explanation in.. numpy's convolve documentation: