[Feature]: Automated gradient testing #144
Labels
enhancement
New feature or request
good first issue
Good for newcomers
qnumerics
Issue for qnumerics hackathon
Feature Description
Background
A big part of the code is writing gradients for integrators, objectives, and constraints for custom objects.
ForwardDiff.jl allows us to calculate analytic gradients, so we should have a function that automates testing the accuracy of our gradients and Jacobians. The function should dispatch over generic Integrators, Objectives, or Constraints, separately. The function should make informative error reporting about where and how the gradients or Jacobians differ.
A useful starting point is the undocumented function
show_diffs
in test/test_utils.jl, which starts this process of informative error reporting. An updated version of that function is included here:These functions can be added to the test_utils.jl file, and should use a few kinds of NamedTrajectory's to be robust to different cases when checking derivatives (e.g.
named_trajectory_type_1(...)
in test_utils.jl).Suggested checklist
Importance
1 (lowest)
What does this feature affect?
Other information
No response
The text was updated successfully, but these errors were encountered: