std::vector<double> residuals;
ceres::Problem::EvaluateOptions eval_opt;
eval_opt.num_threads = 1;
problem_->GetResidualBlocks(&eval_opt.residual_blocks);
problem_->Evaluate(eval_opt, NULL, &residuals, NULL, NULL);
No, you cannot call problem:evaluate from an iteration callback.
What are you trying to do with the residuals?
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/c3f2d600-c90c-464c-aea0-dcaca83964c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No, you cannot call problem:evaluate from an iteration callback.
What are you trying to do with the residuals?
On Tuesday, July 5, 2016 at 2:39:53 PM UTC+2, Sameer Agarwal wrote:No, you cannot call problem:evaluate from an iteration callback.
Ok, that explains the problem :)Then what is the best approach to calculate/get the current residual vector?
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/28f393ef-61a1-45b6-a548-2fb1bbb36324%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/0aa76f9d-a1ef-4d4c-b3e1-e9e6354dd868%40googlegroups.com.
I presume the ability to evaluate elements of the cost function at the end of each iteration is still not possible?
I presume instead one could conduct a bit of a hack and set the maximum number of iterations of the solver to 1, then have an external loop to ceres which calls the solver x times, with the output first evaluated using the method available, before being feed back in as the input to the next iteration?
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/73f66c28-8798-4b7f-9998-35e9bbc4b95c%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/e7e56666-6db2-4cfb-a606-310b0c047a74%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/cb8da66e-4220-4d5a-b6f9-45e71a70fadd%40googlegroups.com.