Пример #1
0
        public NDarray <double> Backward(NDarray <double> accumGrad)
        {
            var x = activation.Grad(LastInput);

            for (int i = 0; i < accumGrad.Count; ++i)
            {
                accumGrad.Data[i] *= x.Data[i];
            }

            return(accumGrad);
        }
Пример #2
0
 public NDarray <Type> Backward(NDarray <Type> accumGrad) => accumGrad *activation.Grad(LayerInput);
Пример #3
0
        public NDarray <U> Backward(NDarray <U> accumGrad)
        {
            var x = activation.Grad(LastInput);

            return(ND.Mul(x, accumGrad));
        }