public double CalculateGradient(double?x = null) { if (x == null) { return(Gradient = Exit.Sum(y => y.ExitNeuron.Gradient * y.Weight) * Sigmoid.DerivativeSigmoid(Value)); } return(Gradient = CalculateError(x.Value) * Sigmoid.DerivativeSigmoid(Value)); }
public virtual double CalculateEntry() { return(Value = Sigmoid.CalculateSigmoid(Entry.Sum(x => x.Weight * x.EntryNeuron.Value) + Bias)); }