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]); } }
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); }