Is Ceres deterministic?

1,329 views
Skip to first unread message

Tobias Nöll

unread,
Apr 16, 2014, 10:32:33 AM4/16/14
to ceres-...@googlegroups.com
Hello there,
first: Thanks for the fantastic work of Ceres!

I have a question that I don't find answered in the documentation.
I'm using Ceres to optimize a bundle adjustment problem.
I have the "problem" that during multiple runs the parameters are slightly differently optimized.
Shouldn't Ceres always optimize the parameters in the same way when called multiple times with the same problem?

In my program this is the case for automatic differentiation and numeric as well. My configuration is:
ceres::Solver::Options options;
options.linear_solver_type = ceres::SPARSE_SCHUR;
options.num_threads = 8;
options.num_linear_solver_threads = 8;

I'm using MKL for Lapack

Is this normal behavior of Ceres (maybe because of the threads) or does this indicate that there could be a problem (e.g. reading uninitialized memory) in my error functional?
Thanks for your feedback!

Regards Tobias

Sameer Agarwal

unread,
Apr 16, 2014, 10:41:40 AM4/16/14
to ceres-...@googlegroups.com
With threading turned in determinacy cannot be guaranteed.
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/7cc40d9a-9dc9-4d8e-8385-193aff064b31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William Rucklidge

unread,
Apr 16, 2014, 6:49:47 PM4/16/14
to ceres-...@googlegroups.com
I've found that Ceres is deterministic if you set "options.num_threads" to a value >1, but keep "options.linear_solver_threads" set to 1. This only gets you part of the available speedup: your residuals and Jacobians are evaluated in parallel, but all the matrix operations run serially.

-wjr



Sameer Agarwal

unread,
Apr 16, 2014, 7:23:53 PM4/16/14
to ceres-...@googlegroups.com
Almost deterministic.. since the gradient computation also happens inside the evaluator and that involves threaded accumulation.. its not as bad the linear solver, but theoretically it can create non-determinism too.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/CABsh3u6Vu-s1szeY5zqtToVYGsC-iC7oALqCLpdZKxz-hmvCvA%40mail.gmail.com.

Jon Zubizarreta Gorostidi

unread,
Oct 10, 2018, 2:03:10 PM10/10/18
to Ceres Solver

Hi, I am solving an iterative non-linear problem using ceres. My configuration is: Levenberg Marquardt, Sparse Normal Cholesky, num_threads = 1 and I use my own parameter block ordering. With this configuration I expect a deterministic behaviour. However, I get diffferent results each run. Do I miss something?

Thanks,

Jon
 

Sameer Agarwal

unread,
Oct 10, 2018, 4:42:36 PM10/10/18
to ceres-...@googlegroups.com
For a well conditioned problem it should be deterministic.  But if your problem is poorly conditioned, then rounding will likely produce non-deterministic results.

--
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.

Jon Zubizarreta Gorostidi

unread,
Oct 11, 2018, 4:32:18 AM10/11/18
to ceres-...@googlegroups.com
Thanks Sameer!

How could I improve the conditioning of my problem? Where can I read about it?

Thanks again for all the support!

Jon

You received this message because you are subscribed to a topic in the Google Groups "Ceres Solver" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ceres-solver/F_bbG_5afnY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/CABqdRUADwES8cOF-SyKMpMuXJMYgFo9qyTtima%3DMLbGqf3hfYA%40mail.gmail.com.

Sameer Agarwal

unread,
Oct 11, 2018, 3:58:49 PM10/11/18
to ceres-...@googlegroups.com

Jon Zubizarreta Gorostidi

unread,
Oct 15, 2018, 6:00:52 AM10/15/18
to Ceres Solver
Really good links! Thanks Sameer.

How could I implement variable scaling with ceres?
I cannot find any function to establish the scale for each variable.

Thanks,

Jon

Sameer Agarwal

unread,
Oct 15, 2018, 5:12:50 PM10/15/18
to ceres-...@googlegroups.com
Jon,
You will have to implement it yourself. There is nothing in the ceres API that enables this right now.
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.

sba...@gmail.com

unread,
Dec 10, 2018, 10:46:14 AM12/10/18
to Ceres Solver
As Tobias ask, I want to know how I can put CERES in deterministic option, my version is V1.12 ? 

best regards

Ali
Reply all
Reply to author
Forward
0 new messages