'Concept Padding in Conovlution:
Suppose we have a matrix and we want to add a padding of 2 (we need to divide the padding on all side of the matrix ) in the case of padding=2 (add one at right ,one at left ,one at top and one at bottom). if padding is odd for-example 3: then we have two add two pads on the right of matxrix and 1 pad at the left , two at the bottom and one at the top. If the padding is 4 we have to add 2 pads on the left , two on the right, two on the top and two on bottom of matrix. can you please help out to do in python and the logic behind it.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|