How to keep output size identic with input size?

Hi,

You can compute output size using this formula: out = floor((in - kernel + 2*padding) / stride) + 1
So, in your case, floor((7 - 1 + 2*1) / 1) +1 = 9. There is two ways to have the identical output size, first of is to use proper kernel size which in your case it is 3 instead of 1. Second approach is to change the padding only for that particular channel which in your case, you need to use zero padding.

For the second approach this post may help you:

Bests

1 Like