Let`s discuss padding and its types in convolution layers. In the convolution layer we have kernels, and to make the final filter more informative, we use padding in the image matrix or any kind of input array. We have three types of padding:
Let`s assume the kernel is a sliding window. We have to come up with a solution to padding zeros on the input array. This is a very famous implementation, and it will be easier to show how it works with a simple example, consider x as a filter and h as an input array.
x [i] = [6, 2]
h [ i] = [1, 2, 5, 4]
Using zero padding, we can compute convolution.
You must invert the filter x, otherwise the operation will be cross-correlation. First step (now with zero padding):
= 2 * 0 + 6 * 1 = 6
= 2 * 1 + 6 * 2 = 14
= 2 * 2 + 6 * 5 = 34
= 2 * 5 + 6 * 4 = 34
= 2 * 4 + 6 * 0 = 8 p >
The result of the convolution for this case listing all the above steps will be: Y = [6 14 34 34 8]
[6 14 34 34 8]
In this type of filling we add zero only to the left of the array and at the top of the 2D input matrix.
[6 14 34 34]
In this padding type, we got a reduced output matrix because the size of the output the array is decreasing. We only used the kernel when we had a compatible position in the h array, in some cases you want to reduce the dimension.
[14 34 34]
This book is not just about learning the code; even if you learn to program. If you want to program professionally, learning to code is not enough; For this reason, in addition to helping you program,...
Vincent Bumgarner has been designing software for nearly 20 years, working in many languages on nearly as many platforms. He started using Splunk in 2007 and has enjoyed watching the product evolve ov...
We are witnessing a movement that will completely transform any part of business and society. The word we have given to this move- ment is Big Data and it will change everything, from the way banks an...
This book is an indispensable guide focuses on Machine Learning and R Programming, in an instructive and conversational tone which helps them who want to make their career in Big Data Analytics/ Data ...