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 set 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$?


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.

| improve this answer | |

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.