Ceres - Iteration callback and state variables.

1,143 views
Skip to first unread message

anders.n...@gmail.com

unread,
Jul 7, 2016, 8:26:52 AM7/7/16
to Ceres Solver
Hi, 

Setup info:
I'm running Ceres version 1.11.0, Windows 64 with the following CMake configuration:  -G "Visual Studio 14 2015 Win64"  -DOPENMP=OFF -DGFLAGS=OFF -DMINIGLOG=ON. All other flags are default.

Problem:
I want to access the updated state variables(the Ceres parameter blocks), in each solver iteration. Instead I always get the initial values.

If I understand the documentation correctly, I need to do the following things to achieve this:
1) Set the Ceres::Solver::Options update_state_every_iteration flag to true.
2) Override the Ceres::Iteration::Callback, "CallbackReturnType operator()(const IterationSummary& summary)" in my class inheriting from Ceres::Iteration::Callback.
3) Access the problem parameter blocks by using problem.GetParameterBlocks(parameterBlocks)", where problem is a reference member in my Iteration Callback class inheriting from Ceres::Iteration::Callback, and parameterBlocks is a local variable of type std::vector<double*>

Question Doing 1,2,3 always gives me the same values of the parameter blocks, what am I missing?

Regards,
Anders

Sameer Agarwal

unread,
Jul 7, 2016, 8:29:30 AM7/7/16
to Ceres Solver

Anders,
Are the iterations actually successful? Parameter blocks only get updated on successful iterations.
Sameer


--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/d6059fde-0568-4db3-9797-b929a02acc05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

anders.n...@gmail.com

unread,
Jul 7, 2016, 9:44:28 AM7/7/16
to Ceres Solver
Hi, 

You were correct. The iteration summary states that the iteration failed. 
I found the problem causing this, my bad It is working as described in the documentation.
Thank you for pointing me in the right direction and quick reply.

Regards,
Anders
Reply all
Reply to author
Forward
0 new messages