-
Notifications
You must be signed in to change notification settings - Fork 8
Add @register_multivariate for n-argument custom operators #239
Copy link
Copy link
Open
Description
Current behavior
ExaModels provides @register_univariate and @register_bivariate for registering custom scalar operators with user-supplied derivatives. There is no equivalent for functions of 3 or more scalar arguments.
New feature
A @register_multivariate(f, n, grad!, hess!) macro (or equivalent) that registers an n-argument scalar function with explicitly provided gradient and Hessian:
# f(x₁, ..., xₙ) -> scalar
# grad!(g, x₁, ..., xₙ) fills the n-vector of partial derivatives
# hess!(H, x₁, ..., xₙ) fills the n×n lower-triangular HessianPersonal Motivation
My primary use case is embedding external physics "black-box" simulators (e.g., MuJoCo MJX, Dojo) into ExaModels problems: x_{t+1} - f(x_t, u_t) = 0 with available Jacobians and Hessians.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels