예제 #1
0
        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));
        }
예제 #2
0
 public virtual double CalculateValue()
 {
     return(Value = Sigmoid.Output(InputSynapses.Sum(a => a.Weight * a.InputNeuron.Value) + Bias));
 }