Search code examples
python-3.xtensorflowneural-network

How to choose the number of hidden layers and nodes?


I'm building a neural network in python 3.6.6 with Tensorflow. I was wondering, how do you choose the number of hidden layers and nodes in those layers? It's for a currency prediction bot, any suggestions for the type of network I should use?


Solution

  • There are many rule-of-thumb methods for determining an acceptable number of neurons to use in the hidden layers, such as the following:

    1. The number of hidden neurons should be between the size of the input layer and the size of the output layer.
    2. The number of hidden neurons should be 2/3 the size of the input layer, plus the size of the output layer.
    3. The number of hidden neurons should be less than twice the size of the input layer.

    These three rules provide a starting point for you to consider. Ultimately, the selection of an architecture for your neural network will come down to trial and error.

    You can refer this article