2
$\begingroup$

I am trying to understand the dimensionality of the outputs of convolution operations. Suppose a convolutional layer with the following characteristics:

  • Input map $\textbf{x} \in R^{H\times W\times D}$
  • A bank of $F$ filters, each of dimension $\textbf{f} \in R^{H'\times W'\times D}$
  • A stride of $<s_x,s_y>$ for the corresponding x and y dimensions of the input map
  • Either valid or same padding (explain for both if possible)

What should be the expected dimensionality of the output map expressed in terms of $H, W, D, F, H', W', s_x, s_y$?

$\endgroup$
  • 1
    $\begingroup$ Maybe a little more self research next time? $\endgroup$ – DuttaA Sep 15 '18 at 18:50
1
$\begingroup$

Below is the answer considering your variables:

where, $p_{x}$ and $p_{y}$ are padding values. (equal on both sides). You can have different padding on left and right side. (similarly top and bottom). If same padding, equation will have $2*p_{x}$ or $2*p_{y}$, else you can just add values of both padding and replace in the equations. (For example $p_{xLeft} + p_{xRight}$)

Padding is optional. Generally thumb rule is add padding such that the equations above produce integers and also add padding such that if stride is 1, output is same as input and if stride is 2, output is half of input.

$\endgroup$
0
$\begingroup$

enter image description here

Credit: Stanford University CS231n Lecture 05

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.