Convolution pad "same" option

Hi,

In theano or tensorflow, they have 2 different option for convolution operation : ‘valid’, ‘same’. I want to produce same size convolution output when I am using even number filter.

However, with current convolution layer, there is no way I can produce same output dimension if the kernel size is even number.

For example : [ 1 2 3 ] convolved with kernel [a b], if I use no pad, I will get 2 output. If I use pad 1, I will get 4 output. I can’t get 3 output.

Is there any solution for this ?

Thanks :slight_smile:

with the current convolution operator there is no way to do this.

Note that you can add an extra F.pad before the convolution to adjust the size to make it have the same size.

I see. For now I will use it. Thanks

IMHO it would be nice if convolution operator give those choices so we can avoid if-else for even number kernel size.