AForge.Neuro.Learning.BackPropagationLearning.BackPropagationLearning C# (CSharp) Method

BackPropagationLearning() public method

Initializes a new instance of the BackPropagationLearning class.
public BackPropagationLearning ( ActivationNetwork network ) : System
network ActivationNetwork Network to teach.
return System
        public BackPropagationLearning( ActivationNetwork network )
        {
            this.network = network;

            // create error and deltas arrays
            neuronErrors = new double[network.Layers.Length][];
            weightsUpdates = new double[network.Layers.Length][][];
            thresholdsUpdates = new double[network.Layers.Length][];

            // initialize errors and deltas arrays for each layer
            for ( int i = 0; i < network.Layers.Length; i++ )
            {
                Layer layer = network.Layers[i];

                neuronErrors[i] = new double[layer.Neurons.Length];
                weightsUpdates[i] = new double[layer.Neurons.Length][];
                thresholdsUpdates[i] = new double[layer.Neurons.Length];

                // for each neuron
                for ( int j = 0; j < weightsUpdates[i].Length; j++ )
                {
                    weightsUpdates[i][j] = new double[layer.InputsCount];
                }
            }
        }