How to reduce iteration number?

634 views
Skip to first unread message

徐维鹏

unread,
Jul 21, 2015, 1:12:00 AM7/21/15
to ceres-...@googlegroups.com
Hi,

I'm solving a optimization problem with Ceres Solver. I'm using LEVENBERG MARQUARDT method. It converges in around 2500 iterations. What can I do to speed it up?
Here's the summary. Thanks.

Solver Summary (v 1.10.0-eigen-(3.2.0)-lapack-suitesparse-(4.2.1)-openmp)

                                     Original                  Reduced
Parameter blocks                         1868                     1868
Parameters                               6538                     6538
Residual blocks                          6498                     6498
Residual                                18560                    18560

Minimizer                        TRUST_REGION
Trust region strategy     LEVENBERG_MARQUARDT

                                        Given                     Used
Linear solver                            CGNR                     CGNR
Preconditioner                         JACOBI                   JACOBI
Threads                                     1                        1
Linear solver threads                       1                        1

Cost:
Initial                          6.455395e+04
Final                            1.256096e+01
Change                           6.454139e+04

Minimizer iterations                     2504
Successful steps                         2096
Unsuccessful steps                        408

Time (in seconds):
Preprocessor                           0.0041

  Residual evaluation                  3.1065
  Jacobian evaluation                 19.8196
  Linear solver                       83.2247
Minimizer                            110.8399

Postprocessor                          0.0001
Total                                110.8442

Termination:                      CONVERGENCE (Function tolerance reached. |cost_change|/cost: 5.442683e-09 <= 1.000000e-08)

Sameer Agarwal

unread,
Jul 21, 2015, 1:15:18 AM7/21/15
to ceres-...@googlegroups.com
Why are you using CGNR for this problem? your version of ceres has support for suitesparse, you will get much better convergence by using SPARSE_NORMAL_CHOLESKY as the linear solver.

JACOBI is not a terribly good preconditioner, but thats all we have right now for general sparse problems.

Further, convergence time depends on what you are looking for.

1. If a more approximate solution is acceptable to you, then you can loosen the convergence criterion.

2. If the convergence is slow because the way your problem is conditioned (observe the rate at which the objective function reduces), then its worth looking into how to rescale the variables so that the overall problem is better conditioned.

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/64b6cc8d-5244-4c95-8ec5-bb66f84ca402%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

徐维鹏

unread,
Jul 21, 2015, 1:26:27 AM7/21/15
to ceres-...@googlegroups.com
Hi Sameer,

Thank you for your prompt reply. I've tried using SPARSE_NORMAL_CHOLESKY. But my Matlab crashed. (I'm using Matlab calling a mex file.)  I think that is due to too many parameters, since it works fine if I reduce the number of parameters. So I'm using CGNR now.
Is there really a limit on number of parameters for SPARSE_NORMAL_CHOLESKY?

Weipeng

Sameer Agarwal

unread,
Jul 21, 2015, 1:27:55 AM7/21/15
to ceres-...@googlegroups.com
Weipeng,
The number of variables and residuals seem rather modest, it should be no problem for SuiteSparse. Is your problem dense?
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.

徐维鹏

unread,
Jul 21, 2015, 1:34:30 AM7/21/15
to ceres-...@googlegroups.com
I think it should be a very sparse problem, since each residual only involves a few of parameters.

Weipeng

Sameer Agarwal

unread,
Jul 21, 2015, 1:36:25 AM7/21/15
to ceres-...@googlegroups.com
Then there is something else is wrong with your code.

On Mon, Jul 20, 2015 at 10:34 PM 徐维鹏 <xuweip...@gmail.com> wrote:
I think it should be a very sparse problem, since each residual only involves a few of parameters.

Weipeng

--
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.
Reply all
Reply to author
Forward
0 new messages