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); }
public NDarray <Type> Backward(NDarray <Type> accumGrad) => accumGrad *activation.Grad(LayerInput);
public NDarray <U> Backward(NDarray <U> accumGrad) { var x = activation.Grad(LastInput); return(ND.Mul(x, accumGrad)); }