Skip to content

Calculate Jacobians with forward AD from num-dual#30

Open
prehner wants to merge 1 commit intorust-cv:mainfrom
prehner:automatic_differentiation
Open

Calculate Jacobians with forward AD from num-dual#30
prehner wants to merge 1 commit intorust-cv:mainfrom
prehner:automatic_differentiation

Conversation

@prehner
Copy link
Copy Markdown

@prehner prehner commented Feb 27, 2026

Hello,

this is in reference to #24 . Jacobians are calculated using forward mode automatic differentiation provided by the num-dual crate. The user only needs to implement the residuals using the DualNum trait bound, everything else comes for free (implementation-wise). Because, with AD the residuals and Jacobians are always evaluated simultaneously, I simplified the interface for the LeastSquaresProblemAD a bit compared to the LeastSquaresProblem trait. Also, num-dual uses the Owned data storage in nalgebra, so this is also hardcoded here, but might be relaxed if that is necessary.

To validate, I adapted the line fitting example in tests. This is still a bit raw and I am happy to clean it up and document it properly if you are interested in having this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant