Expand description
Closure-based API for automatic differentiation.
Provides top-level functions (grad, jvp, vjp, jacobian) that handle
tape setup, variable creation, and derivative extraction. With the bytecode feature,
adds record, hessian, hvp, sparse_jacobian, sparse_hessian, and more.
Functions§
- composed_
hvp bytecode - Forward-over-reverse HVP via type-level composition.
- grad
- Compute the gradient of a scalar function
f : R^n → Rusing reverse mode. - hessian
bytecode - Full Hessian matrix via forward-over-reverse on a bytecode tape.
- hessian_
vec bytecode - Full Hessian matrix via batched forward-over-reverse.
- hvp
bytecode - Hessian-vector product via forward-over-reverse on a bytecode tape.
- jacobian
- Compute the full Jacobian of
f : R^n → R^musing forward mode. - jvp
- Jacobian-vector product (forward mode):
(f(x), J·v). - record
bytecode - Record a function into a
BytecodeTapethat can be re-evaluated at different inputs without re-recording. - record_
multi bytecode - Record a multi-output function into a
BytecodeTape. - sparse_
hessian bytecode - Sparse Hessian via structural sparsity detection and graph coloring.
- sparse_
hessian_ vec bytecode - Batched sparse Hessian: packs N colors per sweep using DualVec.
- sparse_
jacobian bytecode - Sparse Jacobian of a multi-output function via sparsity detection and coloring.
- vjp
- Vector-Jacobian product (reverse mode):
(f(x), wᵀ·J).