saiunit.autograd module

saiunit.autograd module#

Unit-aware automatic differentiation.

Provides grad, value_and_grad, jacobian (jacrev/jacfwd), hessian, and vector_grad that correctly track physical units through JAX’s autodiff transformations.

First-order Gradients#

vector_grad

Unit-aware element-wise gradient of a vector-valued function.

value_and_grad

Physical unit-aware version of jax.value_and_grad.

grad

Physical unit-aware version of jax.grad.

Jacobian Matrix#

jacrev

Physical unit-aware reverse-mode Jacobian of fun.

jacfwd

Physical unit-aware forward-mode Jacobian of fun.

jacobian

Alias of jacrev().

Hessian Matrix#

hessian

Physical unit-aware Hessian of fun as a dense array.