Scalar value computed during the forward pass.
Derivative of the loss with respect to this node, computed during backward.
Backpropagate gradients through the computation graph rooted at this node.
Sets this.grad = 1 and accumulates gradients on all ancestors.
Exponential (e^x).
Natural logarithm.
Negation: -this.
Exponentiation: this ** exponent (exponent is a plain number).
Rectified linear unit: max(0, x).
A scalar value that tracks its computation graph for automatic differentiation.
Because TypeScript has no operator overloading, arithmetic is performed via methods:
a.add(b),a.mul(b),a.pow(n), etc.