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]; } }
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; } }
public double Output() { double wi = _biasWeight; for (int i = 0; i < _inputCount; i++) { wi += Weights[i] * Inputs[i]; } return(Sigmoid.Output(wi)); }