Same convolution

A same convolution is a type of convolution where the output matrix is of the same dimension as the input matrix.

For a n×n input matrix A and a f×f filter matrix F, the output of the convolution AF is of dimension n+2pfs+1×n+2pfs+1 where s represents the stride length and p represents the padding.

In a same convolution:

  • s is typically set to 1
  • p is set to f12
  • f is an odd number

The result is that A is padded to be n+p×n+p and AF becomes n×n – the same as the original dimensions of A.