public double CalculateGradient(double?target = null) { if (target == null) { return(Gradient = OutputSynapses.Sum(a => a.OutputNeuron.Gradient * a.Weight) * Sigmoid.Derivative(Value)); } return(Gradient = CalculateError(target.Value) * Sigmoid.Derivative(Value)); }
public virtual double CalculateValue() { return(Value = Sigmoid.Output(InputSynapses.Sum(a => a.Weight * a.InputNeuron.Value) + Bias)); }