Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Estimating the number of neurons and number of layers of an artificial neural network [closed]

I am looking for a method on how to calculate the number of layers and the number of neurons per layer. As input I only have the size of the input vector, the size of the output vector and the size of the training set.

Usually the best net is determined by trying different net topologies and selecting the one with the least error. Unfortunately I cannot do that.

like image 819
ladi Avatar asked Jul 27 '10 15:07

ladi


People also ask

How do you determine the number of layers and neurons in a neural network?

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

How do you calculate the number of neurons?

One simple way to calculate the neurons is to simply multiply the three dimensions of that layer ( planes X width X height ): Layer 2: 27x27x128 * 2 = 186,624. Layer 3: 13x13x192 * 2 = 64,896.

How many neurons are in artificial neural network?

The number of “neurons” in artificial networks is much less than that (usually in the ballpark of 10–1000) but comparing their numbers this way is misleading. Perceptrons just take inputs on their “dendrites” and generate output on their “axon branches”.

Is there no exact formula for determining the number of hidden layers as many neurons in each hidden layer?

there is no method to calculate the number of layers in the hidden layer of neural networks, while the number of neurons in the layer (size of the hidden layer)is a different term from the number of layers and is calculable.


1 Answers

This is a really hard problem.

The more internal structure a network has, the better that network will be at representing complex solutions. On the other hand, too much internal structure is slower, may cause training to diverge, or lead to overfitting -- which would prevent your network from generalizing well to new data.

People have traditionally approached this problem in several different ways:

  1. Try different configurations, see what works best. You can divide your training set into two pieces -- one for training, one for evaluation -- and then train and evaluate different approaches. Unfortunately it sounds like in your case this experimental approach isn't available.

  2. Use a rule of thumb. A lot of people have come up with a lot of guesses as to what works best. Concerning the number of neurons in the hidden layer, people have speculated that (for example) it should (a) be between the input and output layer size, (b) set to something near (inputs+outputs) * 2/3, or (c) never larger than twice the size of the input layer.

    The problem with rules of thumb is that they don't always take into account vital pieces of information, like how "difficult" the problem is, what the size of the training and testing sets are, etc. Consequently, these rules are often used as rough starting points for the "let's-try-a-bunch-of-things-and-see-what-works-best" approach.

  3. Use an algorithm that dynamically adjusts the network configuration. Algorithms like Cascade Correlation start with a minimal network, then add hidden nodes during training. This can make your experimental setup a bit simpler, and (in theory) can result in better performance (because you won't accidentally use an inappropriate number of hidden nodes).

There's a lot of research on this subject -- so if you're really interested, there is a lot to read. Check out the citations on this summary, in particular:

  • Lawrence, S., Giles, C.L., and Tsoi, A.C. (1996), "What size neural network gives optimal generalization? Convergence properties of backpropagation". Technical Report UMIACS-TR-96-22 and CS-TR-3617, Institute for Advanced Computer Studies, University of Maryland, College Park.

  • Elisseeff, A., and Paugam-Moisy, H. (1997), "Size of multilayer networks for exact learning: analytic approach". Advances in Neural Information Processing Systems 9, Cambridge, MA: The MIT Press, pp.162-168.

like image 138
Nate Kohl Avatar answered Sep 20 '22 05:09

Nate Kohl