예제 #1
0
 public static void NeedPreviousBackwardCpu(this ICompressibleActivation compressibleActivation, NdArray y, NdArray x)
 {
     for (int i = 0; i < x.Grad.Length; i++)
     {
         x.Grad[i] += compressibleActivation.BackwardActivate(y.Grad[i], y.Data[i]);
     }
 }
예제 #2
0
        public static Real[] GetActivatedgy(this ICompressibleActivation <Real> compressibleActivation, NdArray <Real> y, NdArray <Real> x)
        {
            Real[] activatedgy = new Real[y.Grad.Length];

            for (int i = 0; i < activatedgy.Length; i++)
            {
                activatedgy[i] = compressibleActivation.BackwardActivate(y.Grad[i], y.Data[i], x.Data[i]);
            }

            return(activatedgy);
        }