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

GradientProblemSolver::Options does not support update_state_every_iteration #246

Closed
bchretien opened this issue Dec 21, 2016 · 10 comments
Closed
Assignees
Labels

Comments

@bchretien
Copy link

bchretien commented Dec 21, 2016

While implementing a callback for GradientProblemSolver, I realized that update_state_every_iteration is not supported for that kind of solver. Yet, GradientProblemSolver::Options::callbacks's documentation hints at the contrary (here):

// Callbacks are executed in the order that they are specified in
// this vector. By default, parameter blocks are updated only at
// the end of the optimization, i.e when the Minimizer
// terminates. This behaviour is controlled by
// update_state_every_variable. If the user wishes to have access
// to the update parameter blocks when his/her callbacks are
// executed, then set update_state_every_iteration to true.

Are there any plans to support this option, or am I missing something? Otherwise, the documentation should probably be updated. Also, update_state_every_variable is referenced, but I'm assuming this is a typo/legacy name for update_state_every_iteration (it is also present in some other parts of the documentation).

This was tested with Ceres 1.12.0.

@bchretien bchretien changed the title GradientProblemSolver::Options does not support update_state_every_variable GradientProblemSolver::Options does not support update_state_every_iteration Dec 21, 2016
@sandwichmaker sandwichmaker self-assigned this Dec 21, 2016
@sandwichmaker
Copy link
Contributor

@bchretien thanks for reporting this, yes this is a bug in gradientproblemsolver, even though the underlying machinery actually supports this. You can either submit a patch or I can look into it soonish.

@bchretien
Copy link
Author

@sandwichmaker thanks for the quick reply, I probably won't have the time to work on a patch during the next few weeks, but I'll keep you posted if that changes.

bchretien added a commit to bchretien/ceres-solver that referenced this issue Dec 22, 2016
@bchretien
Copy link
Author

bchretien commented Dec 22, 2016

I think I solved the issue (cf. this). I'll forward this to Gerrit when I find the time.

bchretien added a commit to bchretien/ceres-solver that referenced this issue Dec 22, 2016
bchretien added a commit to bchretien/ceres-solver that referenced this issue Dec 22, 2016
@sandwichmaker
Copy link
Contributor

@bchretien that CL looks pretty good. Please do consider sending it to gerrit, I will review as soon as I can.

@sandwichmaker
Copy link
Contributor

@bchretien gentle ping :)

@aecins
Copy link

aecins commented Dec 17, 2017

@bchretien another gentle ping. Ran into this issue this week. It would be really great to see per iteration updates with the gradient solver.

@keir
Copy link
Contributor

keir commented Dec 27, 2017

@bchretien Would happy review your patch in Gerrit; can you please push it over there so we can get it submitted? Due to the CLA issue we can't accept GitHub pull requests (and we want to keep our review history centralized).

@brentmorgan1987
Copy link

Is there a quick fix to see my solution per every iteration? This is needed for me :)....
I could technically write the solution for every Evaluate() call but it would probably slow it down, compared to a "real" fix. Thanks,

Best,
Brent

@sandwichmaker
Copy link
Contributor

@keir keir closed this as completed in 202dd9f Jan 26, 2018
@brentmorgan1987
Copy link

I implemented the changes. What am I supposed to see? I do not see any changes in the stdout.

I set the
update_state_every_iteration = true
in gradient_problem_solver.h

Best,
Brent

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

5 participants