Elementwise tape nodes #
Reusable NodeFDerivCorrect wrappers for scalar functions lifted pointwise to tensors, including
common activations such as ReLU, sigmoid, tanh, SiLU, GELU, ELU, and safe differentiable variants.
CtxVec.get specialized to vector shapes.
Instances For
CtxVec.getCLM specialized to vector shapes .dim n .scalar.
Instances For
Inject a Vec n into a vectorized context at idx (fills other blocks with zeros).
Instances For
Elementwise node: apply a scalar function pointwise on a context entry.
Instances For
Analytic correctness for elemwise nodes from a scalar HasDerivAt hypothesis.
Instances For
Pointwise analytic correctness for elemwise nodes from a coordinatewise HasDerivAt
hypothesis.
Instances For
Runtime relu node (elementwise; nondifferentiable at zero).
Instances For
Pointwise NodeFDerivCorrectAt for relu under the assumption that inputs are nonzero.
Instances For
Runtime abs node (elementwise; nondifferentiable at zero).
Instances For
Pointwise NodeFDerivCorrectAt for abs under the assumption that inputs are nonzero.
Instances For
Runtime log node (elementwise; differentiable only away from zero).
Instances For
Pointwise NodeFDerivCorrectAt for log under the assumption that inputs are nonzero.
Instances For
Elementwise inverse node (differentiable only away from zero).
Instances For
Pointwise NodeFDerivCorrectAt for inv under the assumption that inputs are nonzero.
Instances For
Elementwise "clamped sqrt": sqrt (max x 0) (differentiable on x > 0).
Instances For
Pointwise NodeFDerivCorrectAt for sqrt_clamp under the assumption that inputs are strictly
positive.
Instances For
Runtime sqrt node (elementwise; nondifferentiable at zero).
Instances For
Pointwise NodeFDerivCorrectAt for sqrt under the assumption that inputs are nonzero.
Instances For
Runtime scalar logistic node, applied elementwise.
Vector and matrix softmax use the dedicated last-axis softmax nodes below; this node is the one-dimensional logistic map used by scalar activations.
Instances For
Global NodeFDerivCorrect for logistic (uses the scalar derivative lemma).
Instances For
Runtime sigmoid node (elementwise).
Instances For
Global NodeFDerivCorrect for sigmoid.
Instances For
Runtime tanh node (elementwise).
Instances For
Global NodeFDerivCorrect for tanh.
Instances For
Runtime softplus node (elementwise, smooth ReLU surrogate).
Instances For
Global NodeFDerivCorrect for softplus.
Instances For
Runtime silu node (elementwise).
Instances For
Global NodeFDerivCorrect for SiLU.
Instances For
Runtime tanh-approximate gelu node (elementwise).
Instances For
Global NodeFDerivCorrect for tanh-approximate GELU.
Instances For
Runtime safe_log node (elementwise, always-defined log surrogate).
Instances For
Global NodeFDerivCorrect for safe_log (requires 0 < ε).
Instances For
Runtime smooth_abs node (elementwise, smooth abs surrogate).
Instances For
Global NodeFDerivCorrect for smooth_abs (requires 0 < ε).
Instances For
Runtime exp node (elementwise).
Instances For
Global NodeFDerivCorrect instance for the elementwise exponential.
Instances For
Runtime sinh node (elementwise).
Instances For
Global NodeFDerivCorrect for elementwise hyperbolic sine.
Instances For
Runtime cosh node (elementwise).
Instances For
Global NodeFDerivCorrect for elementwise hyperbolic cosine.
Instances For
Runtime elu node (elementwise; nondifferentiable at zero unless alpha = 1).
Instances For
Pointwise NodeFDerivCorrectAt for ELU under the usual no-coordinate-at-the-kink assumption.
For arbitrary alpha, ELU has left derivative alpha and right derivative 1 at zero. Keeping the
hypothesis here avoids baking PyTorch's subgradient convention into a mathematical derivative
theorem.
Instances For
Unary node applying an analytically-correct OpSpec at a context index.
Instances For
NodeFDerivCorrect for unaryOp.
Instances For
Linear layer as a single tape node (fixed weights/bias in the Spec.LinearSpec).
Instances For
NodeFDerivCorrect for linear: the node derivative matches the spec's OpSpec derivative.