The continuous case
Convolution is defined as an operation between 2 functions f and g such that:
![]()
Example:

The area under the convolution
is the product of the areas under f and g.
1 D Discrete Case
![]()
and suppose n starts from 0. We are computing h[n]=f[n]*g[n].


A tiny toy example of CNN that is made up of just one conv layer consisting of just one filter F of shape 2×2 followed by a max-pooling layer of shape 2×2. The input image is of shape 3×3.
The output of the CNN is calculated a Pool(ReLU(Conv(I))) where:
![]()
if:
![Rendered by QuickLaTeX.com I=\left[\begin{array}{lll}1 & 0 & 2 \ 3 & 1 & 0 \ 0 & 0 & 4\end{array}\right]](https://ayoubb.com/wp-content/ql-cache/quicklatex.com-e6c0af87b6fad06299534418240e71df_l3.png)
![]()
The output of the CNN is 5.