title: Number of neuron in CNN architecture
body: <p>I am using a certain CNN architecture, however, I am not sure how to calculate the exact number of neuron I have in it.</p>
  <pre><code>        self.conv1 = nn.Conv2d(in_channels=1, out_channels=16,
                                 kernel_size=(7, 7), padding=(1, 1),
                                 stride=(2, 2))
  
          self.conv2 = nn.Conv2d(in_channels=16, out_channels=32,
                                 kernel_size=(7, 7), padding=(1, 1),
                                 stride=(2, 2))
  
          self.conv3 = nn.Conv2d(in_channels=32, out_channels=64,
                                 kernel_size=(3, 3), padding=(2, 2),
                                 stride=(2, 2))
  
          self.fc1 = nn.Linear(64 * 1 * 1, 8)
  </code></pre>
  <p>There is also <code>2D-maxpooling</code> after each <code>convolution layer</code> with stride of <code>2</code>.</p>
  <p>I can get the number of parameters and Gmacs in my network, but I am not sure how to get the number of neurons?</p>
  <p>Is there a certain way to calculate them?</p>
  <p>Thanks.</p>