Answers.Body: <p><a href="https://i.sstatic.net/S4RuC.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/S4RuC.gif" alt="Below is the answer considering your variables:"></a></p>
  
  <p>where, <span class="math-container">$p_{x}$</span> and <span class="math-container">$p_{y}$</span> 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 <span class="math-container">$2*p_{x}$</span> or <span class="math-container">$2*p_{y}$</span>, else you can just add values of both padding and replace in the equations. (For example <span class="math-container">$p_{xLeft} + p_{xRight}$</span>)</p>
  
  <p>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. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-17T13:29:24.360Z
Answers.LastActivityDate: 2018-12-17T13:38:37.943Z
Answers.LastEditDate: 2018-12-17T13:38:37.943Z
Answers.UserDisplayName: Kartik Podugu
Body: <p>I am trying to understand the dimensionality of the outputs of convolution operations. Suppose a convolutional layer with the following characteristics:</p>
  
  <ul>
  <li>Input map <span class="math-container">$\textbf{x} \in R^{H\times W\times D}$</span></li>
  <li>A set of <span class="math-container">$F$</span> filters, each of dimension <span class="math-container">$\textbf{f} \in R^{H'\times W'\times D}$</span></li>
  <li>A stride of <span class="math-container">$&lt;s_x, s_y&gt;$</span> for the corresponding <span class="math-container">$x$</span> and <span class="math-container">$y$</span> dimensions of the input map</li>
  <li>Either valid or same padding (explain for both if possible)</li>
  </ul>
  
  <p>What should be the expected dimensionality of the output map expressed in terms of <span class="math-container">$H, W, D, F, H', W', s_x, s_y$</span>?</p>
  
Tags: <neural-networks><deep-learning><convolutional-neural-networks>
Title: What is the dimensionality of the output map, given the dimensionality of the input map, number of filters, stride and padding?
UserDisplayName: Nicolas Schejtman
ThreadText: # What is the dimensionality of the output map, given the dimensionality of the input map, number of filters, stride and padding?
  
  (Asked by: username_0 on 2018-09-15)
  
  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$?
  
  **Tags:** neural-networks, deep-learning, convolutional-neural-networks
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-12-17. Score: 1
  
  [![Below is the answer considering your variables:](https://i.sstatic.net/S4RuC.gif)](https://i.sstatic.net/S4RuC.gif)
  
  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.
  
  
  ---
  
  