title: Dimensions in convolutional neural network
body: <p>I am trying to understand how the dimensions in convolutional neural network behave. In the figure below the input is 28-by-28 matrix with 1 channel. Then there are 32 5-by-5 filters (with stride 2 in height and width). So I understand that the result is 14-by-14-by-32. But then in the next convolutional layer we have 64 5-by-5 filters (again with stride 2). So why the result is 7-by-7- by 64 and not 7-by-7-by 32*64? Aren't we applying each one of the 64 filters to each one of the 32 channels?</p>
  
  <p><a href="https://i.stack.imgur.com/p2Eqm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/p2Eqm.png" alt="enter image description here"></a></p>