The post about how to choose the amount of hidden layers and neurons was extremely helpful. The rules of thumb given gave me often a good point to start. However, I'm now thinking about varying the number of Neurons per layer.

How should one choose different number of neurons per layer? Any rules of thumb? And is there maybe a good explanation how e.g. a bottleneck or an enlargement of a layer in between influences the network?


Some more background information about the problem. I'm working on some Reinforcement Learning Projects. I used Q-Learning so far and am now trying some DQN stuff. I started with OpenAi Gyms Cartpole game to test some basics. There are currently an input vector of length 4 and an output vector of length 2. With the rule of thumb I've chosen 2 hidden layers. 7 neurons per layer worked best so far. The loss is MSE and I train with an ADAM optimizer. As Activation function a ReLu is used.

However, some more general answers would be great to, since this is only a small test project for later work.

  • 1
    $\begingroup$ There are some guidelines, but it depends quite a bit on what problem you are modeling. Are you working on dimension reduction? Representation learning? Object detection? Compressed sensing? Tell us you problem and we may be able to help you. $\endgroup$ – DeltaIV Nov 9 '18 at 11:09
  • 1
    $\begingroup$ Uuugh Deep RL? No, thanks, not touching that with a ten foot pole. There's so much sketchy stuff going on in DRL, that the rest of Deep Learning looks like linear regression, in comparison. I hope someone will be able to help you, but personally I doubt anyone knows what's really going on with Deep RL. $\endgroup$ – DeltaIV Nov 10 '18 at 11:04
  • $\begingroup$ Well that doesn't help much. Thats why I didn't gave further information in the first case. Because I wanted a more general explanation which would be helpful in e.g. supervised cases too. $\endgroup$ – Mr.Sh4nnon Nov 10 '18 at 11:06
  • $\begingroup$ Sorry, but the point is that what we know about supervised learning doesn't really apply to DRL (it sorts of applies to classic RL): I could give you the "standard" version, but I'm conviced I'd just be fooling you. Have a look at the papers I linked, if you don't believe me, or have a look at the very insightful series of blog posts Ben Recht wrote. argmin.net/2018/06/25/outsider-rl $\endgroup$ – DeltaIV Nov 10 '18 at 11:11
  • $\begingroup$ If you insist, can give you the link to the answer I wrote on bottleneck layers of autoencoders. But personally I feel like I'd be lying to you. And anyway, you did well to explain your use case. Maybe someone else will be able to help you. For a less skeptical approach to DRL, see here. For a very different point of view (an enthusiastic introduction), see here. $\endgroup$ – DeltaIV Nov 10 '18 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.