0
$\begingroup$

Should kernel size always be a prime number? E.g. (3,3) (5,5) (7,7).

While tinkering with sklearn.preprocessing.KernelCenterer(), I noticed that I could only get it to work on a 3,3 array not 2,3 not 6,1.

Then I realized that in a square that is prime-by-prime, there is always a center - hence Centerer.

[ ][ ][ ]
[ ][X][ ]
[ ][ ][ ]


[ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ]
[ ][ ][X][ ][ ]
[ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ]
$\endgroup$
1
  • $\begingroup$ ha - most low odds are prime. yikes $\endgroup$ – HashRocketSyntax Jan 11 at 1:56
3
$\begingroup$

Odd numbers, usually, but not necessarily. This can depend on the problem at hand. The odd length of the side of the kernel is used in order to emphasize the center of the kernel. For a more detailed discussion of the geometry of kernels and convnets have a look at this thesis.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.