Accord.Neuro.Learning.ParallelResilientBackpropagationLearning.Run C# (CSharp) Method

Run() public method

Runs learning iteration.

Runs one learning iteration and updates neuron's weights.

public Run ( double input, double output ) : double
input double Input vector.
output double Desired output vector.
return double
        public double Run(double[] input, double[] output)
        {
            // Zero gradient
            ResetGradient();

            // Compute forward pass
            network.Compute(input);

            // Copy network outputs to local thread
            var networkOutputs = this.networkOutputs.Value;
            for (int j = 0; j < networkOutputs.Length; j++)
                networkOutputs[j] = network.Layers[j].Output;

            // Calculate network error
            double error = CalculateError(output);

            // Calculate weights updates
            CalculateGradient(input);

            // Update the network
            UpdateNetwork();

            return error;
        }