How to choose the number of nodes in layer recurrent networks? When using NNs for estimation purpose, we have three layers: input, output and hidden layer, and we must choose the number of nodes for every layer.
Is there a method or rule of thumb to choose the correct number of nodes?
 A: The input layer must be as large as the number of inputs you have. e.g. if your input is made up of 64 bits, then your input layer should be 64 large (note: instead of using 0s and 1s as inputs you might be better off using -0.5 and 0.5 as inputs).
The output layer must be as large as the output you want.  If you want a simple discrimination, e.g. after rounding, 1 if the input is an element of a set and 0 otherwise, then your output size should be 1.  
If you want the output to vote on the membership of the input in one of many sets, then you might want the output size to be the number of sets that the input can be an element of.  e.g. if the input can be either a red car, a blue car or a white car, then you might want the output size to be 3.  The Neural Network will map the input to the set represented by the output node with the highest value.
The above is the simple part of the answer.  Estimating the size of the middle layer is harder.  
Some rule of thumbs include (which I personally do not subscribe to - as does the author of this reference:


*

*some number between the number of input neurons and the number of output neurons;

*not more than twice the number of input neurons; and

*the number of principal components required to capture about 90% of the data.


In my opinion, I would choose the something close to the smallest number that allows me to generalise well on the test data but not too much larger.  This will help the NN to converge faster and generalise enough without training to become too specific in its discrimination.
Other references you might wish to look into are as follows:
1 - also suggests whether and how many input layers you need; and
2 - another answer available in stack-overflow regarding the same question.
