Skip to main content

Module api

Module api 

Source
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_hvpbytecode
Forward-over-reverse HVP via type-level composition.
grad
Compute the gradient of a scalar function f : R^n → R using reverse mode.
hessianbytecode
Full Hessian matrix via forward-over-reverse on a bytecode tape.
hessian_vecbytecode
Full Hessian matrix via batched forward-over-reverse.
hvpbytecode
Hessian-vector product via forward-over-reverse on a bytecode tape.
jacobian
Compute the full Jacobian of f : R^n → R^m using forward mode.
jvp
Jacobian-vector product (forward mode): (f(x), J·v).
recordbytecode
Record a function into a BytecodeTape that can be re-evaluated at different inputs without re-recording.
record_multibytecode
Record a multi-output function into a BytecodeTape.
sparse_hessianbytecode
Sparse Hessian via structural sparsity detection and graph coloring.
sparse_hessian_vecbytecode
Batched sparse Hessian: packs N colors per sweep using DualVec.
sparse_jacobianbytecode
Sparse Jacobian of a multi-output function via sparsity detection and coloring.
vjp
Vector-Jacobian product (reverse mode): (f(x), wᵀ·J).