Body: <p>I have noticed that almost all tutorials take the number of neurons as a power of 2. Is there any proper mathematical and well-proven reason for that? </p>
  
  <p>If you sometimes change it to some other odd value, then we get a very long and weird error calling about a dozen things making the traceback of a page. Is there any reason for that?      </p>
  
  <blockquote>
    <p>I had tried it on a text predicting RNN with some GRU and LSTM layers mixed (bidirectional). I changed the no. of neuron units and It also resulted in an error. So, any ideas/theories?</p>
  </blockquote>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-21T20:54:29.217Z
Comments.Text: Hi and welcome to AI SE! You say "If you sometimes change it to some other odd value, then we get a very long and weird error calling about a dozen things making the traceback of a page", but I don't think this is caused by the fact that the number of neurons is not a power of 2. So, can you provide a concrete example where that occurs? Also, note that, for each layer, you may have a different number of neurons.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-22T17:50:09.240Z
Comments.Text: @nbro, No I do not have a concrete example. I have just migrated to another OS so most of my code is lost. But even then in most tutorials the no. is always a power of 2. So I was wondering what reason was there behind it.....
Comments.UserDisplayName: neel g
Tags: <neural-networks><machine-learning><ai-design><hyper-parameters>
Title: Why is the number of neurons used in various neural networks power of 2?
UserDisplayName: neel g
ThreadText: # Why is the number of neurons used in various neural networks power of 2?
  
  (Asked by: username_0 on 2020-04-21)
  
  I have noticed that almost all tutorials take the number of neurons as a power of 2. Is there any proper mathematical and well-proven reason for that?
  
  If you sometimes change it to some other odd value, then we get a very long and weird error calling about a dozen things making the traceback of a page. Is there any reason for that?
  
  > I had tried it on a text predicting RNN with some GRU and LSTM layers mixed (bidirectional). I changed the no. of neuron units and It also resulted in an error. So, any ideas/theories?
  
  **Tags:** neural-networks, machine-learning, ai-design, hyper-parameters
  
  > **Comments:**
  > **username_1**: Hi and welcome to AI SE! You say "If you sometimes change it to some other odd value, then we get a very long and weird error calling about a dozen things making the traceback of a page", but I don't think this is caused by the fact that the number of neurons is not a power of 2. So, can you provide a concrete example where that occurs? Also, note that, for each layer, you may have a different number of neurons.  
  > **username_0**: @username_1, No I do not have a concrete example. I have just migrated to another OS so most of my code is lost. But even then in most tutorials the no. is always a power of 2. So I was wondering what reason was there behind it.....  
  
  ---
  
  ## 0 answers
  
  