tags:

views:

534

answers:

1

I am using the AForge.NET framework to create a feedforward, backpropagation neural network. I have it setup and it's learning and all just fine, the problem is it outputs the same number regardless of what the input data is. I'm using various technical indicators on a stock market symbol and each one of these is an input neuron. The data comes in at a range of -100 and 100. The output should be in the range of -1 and 1. The following is my code for creating and training the network. Again, this works fine, but I only get the same output regardless of input.

public void CreateNetwork()
{
    network = new ActivationNetwork(new BipolarSigmoidFunction(2), INPUT_SIZE, NEURONS_HIDDEN_1, NEURONS_HIDDEN_2, OUTPUT_SIZE);
    network.Randomize();
}


private void TrainNetworkHybrid()
{
    //ITrain train = new ResilientPropagation(this.network, this.dataset);
    BackPropagationLearning teacher = new BackPropagationLearning(this.network);
    double lastError = Double.MaxValue;
    int epoch = 1;

    do
    {
        //train.Iteration();
        //double error = train.Error;
        double error = teacher.RunEpoch(this.input, this.ideal) / this.ideal.Length; //input.Length && ideal.Length = 8000
        backgroundWorker1.ReportProgress(0, "Iteration(ResProp) #" + epoch + " Error:"
                + error);

        if (error > 0.05)
        {
            if (trainAnneal == true)
            {
                TrainNetworkAnneal();
                trainAnneal = false;
            }
        }

        lastError = error; //error changes but output is always the same number for any type of input data
        epoch++;
        if (epoch % 10 == 0)
        {
            saveBlind();
        }
    } while (lastError > MAX_ERROR && backgroundWorker1.CancellationPending == false && epoch < MAX_ITERATIONS);
}

And my output prediction looks like this (I had to do a screenshot because I forgot to include copypasta functionality :/).

Edit: Problem solved, needed to normalize my inputs to be in the correct range as my output.

A: 

Hi =) Could you please share your backpropagation network learning project with me? I'm a bit interested in it)) mailto: [email protected]

Thx!)

Eugene