public void CalculateOutputGradient(double target) { double delta = target - this.Output; this.Gradient = delta * Neuron.ActivationDerivative(this.Output); }
/// <summary> /// Calculate the hidden gradient based on the sum /// of the weight to the nodes in the next layer /// multiplied by the hidden gradient of those /// nodes. /// </summary> public void CalculateHiddenGradient() { double dow = this.SumDOW(); this.Gradient = dow * Neuron.ActivationDerivative(this.Output); }