In: Computer Science
Input data:
0.0975 0.9572 0.9595 0.7431 0.0462 0.4387 0.6463
0.2785 0.4854 0.6557 0.3922 0.0971 0.3816 0.7094
0.5469 0.8003 0.0357 0.6555 0.8235 0.7655 0.7547
0.9575 0.1419 0.8491 0.1712 0.6948 0.7952 0.2760
0.9649 0.4218 0.9340 0.7060 0.3171 0.1869 0.6797
0.1576 0.9157 0.6787 0.0318 0.9502 0.4898 0.6551
0.9706 0.7922 0.7577 0.2769 0.0344 0.4456 0.1626
Filter:
0.1190 0.3404 0.7513
0.4984 0.5853 0.2551
0.9597 0.2238 0.5060
Zero Padding: 1
Stride: 1
Calculate the convolution between the input and the filter.
I 've calculated this using Excel. It is easy in Excel. We will just right the formula in 1 cell, and the just copy & paste the formula in other cells to get the values for different positions.
I ll also show how the filter is convolving over the input data matrix.
Here is the final output:
Copy the formula from K2 and paste in other cells. Formula is shown here:
=(A1*$A$11)+(B1*$B$11)+(C1*$C$11)+(A2*$A$12)+(B2*$B$12)+(C2*$C$12)+(A3*$A$13)+(B3*$B$13)+(C3*$C$13)
Now see the filter convolving from left to right (in green):
and so on....
Now see the formula and the cells being used for calculation for K2 (i.e. row-0, column-0 for output)
For cell L2:
For cell M2:
Similarly for cell K4:
Here you can see the complete formula :