# How to select topology for neural network?

I was given a target function to design neural network and train: (y = (x1 ∧ x2) ∨ (x3 ∧ x4))

The number of input and number of output seems obvious (4 and 1). And the training data can use truth table.

However, in order to train as a multilayer artificial neural network, I need to choose number of hidden units. May I know where can I find some general guideline for this?

Thank you!

• @AlexSKinman I deleted my previous comment because the 3-D case I gave was a bad example (that one is indeed linearly separable). I tried training a 4x1 network on the y = (x1 ∧ x2) ∨ (x3 ∧ x4) problem numerous times and could not get it to learn the function (the best it would do was accuracy of 0.9375 (i.e., one input was always misclassified). Using a 4x2x1 network, the function was easily learned. If you believe you can construct a separating hyperplane, perhaps you could provide its coefficients (i.e., the a coefficients for f(x) = a1*x1 + a2*x2 + a3*x3 + a4*x4 - a0). – bogatron Mar 6 '15 at 6:05