Hi again!
The mathematics come from this article:
As the author wrote:
The convolution of the filter matrix with input image is same as rotating the filter by 180 degrees and then carrying out the correlation of the rotated filter matrix with the input matrix.
Earlier in the article, he sais he’s going refer to “correlation” as “convolution”. I admit that might be a bit confusing. So when he sais:
In order to obtain the gradients of the input matrix we need to rotate the filter by 180 degree and calculate the full convolution of the rotated filter by the gradients of the output with respect to error […]
he’s doing a 180 degree rotation then a correlation (not convolution), but that is precisely what a “real” convolution is.
So we end up using a convolution for that part, and correlation everywhere else. Any ways, I advise to read his article because despite this confusion, the mathematics are explained clearly with some drawings.
Cheers,