Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracting Jacobian Matrix #340

Open
B0Bftl opened this issue Feb 11, 2019 · 4 comments
Open

Extracting Jacobian Matrix #340

B0Bftl opened this issue Feb 11, 2019 · 4 comments
Labels

Comments

@B0Bftl
Copy link

B0Bftl commented Feb 11, 2019

Hello,

I am implementing a Conjugate Gradient linear solver with a special preconditioning. To use it, I need the Jacobian of the error vector, instead of the Hessian, which g2o passes to the solver.
Right now I'm trying to work my way through g2o internals, to understand how to extract the jacobian.

My current idea is to adjust constructQuadraticForm() and write the current Jacobian block into the jacobian of the complete problem. Is is advisable, or is there an easier way to accomplish getting the jacobian to a linear solver? Has anyone done this before, or knows what adjustments are needed?

Thanks for your help

@billamiable
Copy link

Hi, I am also interested in this question. Have you ever succeeded in extracting the jacobian matrix from g2o? Thanks! Appreciate your help!

@sjulier
Copy link
Collaborator

sjulier commented Jan 27, 2021

I haven't done it myself. However, I'd hazard a guess you could build it up by iterating over all the edges, extracting all the Jacobians and using them to populate a sparse block matrix (or another sparse matrix type of your own choosing) whose number of rows and columns is that of the overall system. You'd need to use the Hessian indices from the vertices to specify the block coordinates in the sparse matrix. I think the buildSystem method does a similar kind of thing to construct both the Hessian and the Jacobian times the system information matrix.

@B0Bftl
Copy link
Author

B0Bftl commented Jan 28, 2021

Hello,
I made an implementation a couple of years ago. My Implementation of extraction of the jacobian is NOT efficient, but it worked good enough for me. I focused on the linear solver, so the jacobian was just a requirement i needed.
You can take a look at my fork https://github.com/B0Bftl/g2o
Maybe it's useful to you :)

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants