Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm new to neural networks and I'm using Aforge Neural network library for a character recognition task. I want to use the back propagation to train my network. Here's the code given in the AForge Documentation.

// initialize input and output values
        double[][] input = new double[4][] {
                new double[] {0, 0}, new double[] {0, 1},
                new double[] {1, 0}, new double[] {1, 1}
            };
        double[][] output = new double[4][] {
                new double[] {0}, new double[] {1},
                new double[] {1}, new double[] {0}
            };
        // create neural network
        ActivationNetwork network = new ActivationNetwork(
            SigmoidFunction(2),
            2, // two inputs in the network
            2, // two neurons in the first layer
            1); // one neuron in the second layer
        // create teacher
        BackPropagationLearning teacher = new BackPropagationLearning(network);
        // loop

        while (!needToStop)
        {
            // run epoch of learning procedure
            double error = teacher.RunEpoch(input, output);
            // check error value to see if we need to stop
            // ...
        }

But I don't know how to decide the Number of layers and Neurons for the ActivationNetwork. Any help would be appreciated. Thanks.

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.