IKH

Important Formulas

In this segment, you will go through useful formulas for calculating the output size using the input size, filter size, padding and stride length. 

Fun Challenge

Before moving on to the lecture, you may want to try solving this problem yourself first: Given an image of size (n, n), a (k, k) filter, padding of p pixels on either side of the image, and stride length of S,  derive a general formula for computing the output size after convolution.

Given the following size :

  • Image  – n x n
  • Filter – k x k
  • Padding – P
  • Stride – S

After padding, we get an image of size (n + 2P) x (n+2P). After we convolve this padded image with the filter, we get:

Size of convolved image = (n+2P−kS+1),(n+2P−kS+1)

Until now, we have applied convolution only on 2D arrays, but most images are coloured and thus have multiple channels (e.g. RGB). In the next segment, you will learn to convolve images with multiple channels.

Report an error