Available on crate feature
ndarray only.Expand description
ndarray adapters for echidna’s bytecode tape AD.
Thin wrappers accepting Array1<F> and returning Array1<F> / Array2<F>.
All functions here accept non-contiguous arrays (slices, transposed
views, stepped views). Input data is copied element-wise via
iter().copied() before being passed to the tape; the previous
.as_slice().unwrap() path panicked on any non-C-contiguous layout,
which was inconsistent with the faer/nalgebra adapters.
Functions§
- grad_
ndarray - Record a function and compute its gradient, returning an
Array1. - grad_
ndarray_ val - Record a function, compute value and gradient, returning
(value, Array1). - hessian_
ndarray - Record and compute the Hessian, returning
(value, gradient, hessian). - hvp_
ndarray - Compute the Hessian-vector product, returning
(gradient, hvp)asArray1. - jacobian_
ndarray - Compute the Jacobian of a multi-output function, returning
Array2<F>. - sparse_
hessian_ ndarray - Compute the sparse Hessian, returning
(value, gradient, pattern, values). - sparse_
jacobian_ ndarray - Compute the sparse Jacobian, returning
(outputs, pattern, values). - tape_
gradient_ ndarray - Evaluate gradient on a pre-recorded tape, accepting and returning ndarray types.
- tape_
hessian_ ndarray - Evaluate Hessian on a pre-recorded tape, accepting and returning ndarray types.
- tape_
hvp_ ndarray - Compute the Hessian-vector product on a pre-recorded tape, returning
(gradient, hvp). - tape_
sparse_ hessian_ ndarray - Compute the sparse Hessian on a pre-recorded tape.