public abstract void Backward(Scalar <Type> delta, Backpropagation bp);
private static Scalar <Type> notImplemented(Scalar <Type> x, Scalar <Type> y, Scalar <Type> f) { throw new NotImplementedException(); }
public static bool IsConst <T>(this Scalar <T> thiz, T value) => thiz is Scalar <T> .Const c && c.Value.Equals(value);
public Binary Clone(Scalar <Type> x, Scalar <Type> y) => new Binary(this.FunctionName, x, y, this.Dx, this.Dy, this._extraInputs);
public Scalar <Type> Clone(Scalar <Type> x) => new Unary(FunctionName, x, Dx, _extraInputs);
public override void Backward(Scalar <Type> delta, Backpropagation bp) => bp.PushGradientTo(x, delta * (_dx = _dx ?? Dx(x, this)));
/// <summary> A simple operator with one input. </summary> /// <param name="functionName">Typehe functionName used by the compiler</param> /// <param name="x">the only input</param> /// <param name="dx">the derivative of this expression wrt x</param> /// <param name="extraInputs"></param> public Unary(string functionName, Scalar <Type> x, Func <Scalar <Type>, Scalar <Type>, Scalar <Type> > dx, object[] extraInputs = null) : base(functionName, new[] { x }, extraInputs) { this.Dx = dx; }
public override void Backward(Scalar <Type> delta, Backpropagation bp) { }