Answers.Body: <blockquote>
  <p>Is average pooling equivalent to a strided convolution with a specific constant kernel?</p>
  </blockquote>
  <p>Yes.</p>
  <blockquote>
  <p>Why then are explicit pooling layers needed if they can be realized by convolutions?</p>
  </blockquote>
  <p>It is probably because the convolution is more expensive than the usual/natural implementation (i.e. just summing and then dividing).</p>
  <p>To see why, let's consider your example. If you implement pooling with a convolution (or cross-correlation), we would need to perform <span class="math-container">$9$</span> multiplications, then <span class="math-container">$8$</span> summations, for a total of <span class="math-container">$17$</span> operations. If we implement pooling as usual, we would need to perform <span class="math-container">$8$</span> summations and <span class="math-container">$1$</span> division (or multiplication), for a total of <span class="math-container">$9$</span> operations.</p>
  <p>Moreover, convolution may also be more prone to numerical instability (multiplications of numbers in the range <span class="math-container">$[0, 1]$</span> are not nice), but I am not completely sure about this, given that we multiply always by the same numbers.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-16T00:07:38.323Z
Answers.LastActivityDate: 2020-11-16T00:16:17.420Z
Answers.LastEditDate: 2020-11-16T00:16:17.420Z
Answers.UserDisplayName: nbro
Body: <p>It seems to me that average pooling can be replaced by a strided convolution with a constant kernel. For instance, a 3x3 pooling would be equivalent to a strided convolution (of stride <span class="math-container">$3$</span>) with a <span class="math-container">$3 \times 3$</span> matrix of constants, with each entry being <span class="math-container">$\frac{1}{9}$</span>.</p>
  <p>However, I haven't found any mention of this fact online (perhaps it's too trivial of an observation)? Why then are explicit pooling layers needed if they can be realized by convolutions?</p>
  
Tags: <neural-networks><convolutional-neural-networks><implementation><convolution><pooling>
Title: Is average pooling equivalent to a strided convolution with a specific constant kernel?
UserDisplayName: 1110101001
ThreadText: # Is average pooling equivalent to a strided convolution with a specific constant kernel?
  
  (Asked by: username_0 on 2020-11-14)
  
  It seems to me that average pooling can be replaced by a strided convolution with a constant kernel. For instance, a 3x3 pooling would be equivalent to a strided convolution (of stride $3$) with a $3 \times 3$ matrix of constants, with each entry being $\frac{1}{9}$.
  
  However, I haven't found any mention of this fact online (perhaps it's too trivial of an observation)? Why then are explicit pooling layers needed if they can be realized by convolutions?
  
  **Tags:** neural-networks, convolutional-neural-networks, implementation, convolution, pooling
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-11-16. Score: 1 | Accepted answer
  
  > Is average pooling equivalent to a strided convolution with a specific constant kernel?
  
  Yes.
  
  > Why then are explicit pooling layers needed if they can be realized by convolutions?
  
  It is probably because the convolution is more expensive than the usual/natural implementation (i.e. just summing and then dividing).
  
  To see why, let's consider your example. If you implement pooling with a convolution (or cross-correlation), we would need to perform $9$ multiplications, then $8$ summations, for a total of $17$ operations. If we implement pooling as usual, we would need to perform $8$ summations and $1$ division (or multiplication), for a total of $9$ operations.
  
  Moreover, convolution may also be more prone to numerical instability (multiplications of numbers in the range $[0, 1]$ are not nice), but I am not completely sure about this, given that we multiply always by the same numbers.
  
  
  ---
  
  