public override void adjustWeights() { this.errorToBP = calcErrorProjectedFromNextNeurons() * NeuronActivation.Derivative(summation); double e = this.errorToBP * learningRate; for (int c = 0; c < this.weights.Length; c++) { this.weights [c] -= this.input [c] * e; } bais -= e; }
/// <summary> /// This function adjusts the weights of the Neuron. /// This function must be called after the expected value has been /// set. /// </summary> public override void adjustWeights() { if (expectedValueCalled != true) { throw new Exception("Expeected Value not given"); } errorToBP = this.error * NeuronActivation.Derivative(summation); double e = this.learningRate * errorToBP; for (int c = 0; c < this.weights.Length; c++) { this.weights [c] -= this.input [c] * e; } bais -= e; expectedValueCalled = false; }
/// <summary> /// This function adjusts the weights of the Neuron after getting the /// value which is expected out of the neuron /// </summary> public void adjustWeights(double expectedValue) { if (expectedValueCalled != true) { this.expectedValue(expectedValue); } errorToBP = this.error * NeuronActivation.Derivative(summation); double e = this.learningRate * errorToBP; for (int c = 0; c < this.weights.Length; c++) { this.weights [c] -= this.input [c] * e; } bais -= e; expectedValueCalled = false; }