border_mode for convolutional layers in keras
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:

http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.convolve.html