Beispiel #1
0
 public void AdjustErrors(Neuron outputNeuron)
 {
     for (int i = 0; i < _neuronCount; i++)
     {
         Neurons[i].Error = Sigmoid.Derivative(Neurons[i].Output()) * outputNeuron.Error * outputNeuron.Weights[i];
     }
 }
Beispiel #2
0
        public void AdjustErrorsBasedOnExpectResult(double[] result)
        {
            for (int i = 0; i < _neuronCount; i++)
            {
                var output = Neurons[i].Output();

                var globalError = Sigmoid.Derivative(output) * (output - result[i]);
                Neurons[i].Error = globalError;
            }
        }
Beispiel #3
0
        public double Output()
        {
            double wi = _biasWeight;

            for (int i = 0; i < _inputCount; i++)
            {
                wi += Weights[i] * Inputs[i];
            }

            return(Sigmoid.Output(wi));
        }