public double[] Gradient(double[] threshold) { double[] gradient = new double[threshold.Length]; for (int i = 0; i < gradient.Length; i++) { gradient[i] = function.Gradient(threshold[i]); } return(gradient); }
public Matrix Gradient(Matrix x) { if (!x.IsVector()) { throw new Exception(); } Matrix ret = new Matrix(x.GetRowCount(), x.GetColumnCount()); for (int i = 0; i < ret.GetRowCount(); i++) { ret[i, 0] = function.Gradient(x[i, 0]); } return(ret); }
public override NDArray <Type> Backward(NDArray <Type> accumGrad) { return(accumGrad * activation.Gradient(layerInput)); }
internal double Gradient(double x) { return(function.Gradient(x)); }