I am trying to set parameter bounds for my problem, and I have observed that just setting the bounds makes the optimization not do anything, even though the initial values are well within the bounds.
The context is an ICP like problem, where I compute correspondences every iteration and optimize the relative transformation. I have narrowed this to just a translation and just the first ICP iteration to show the problem.
If I set parameter_tolerance and function_tolerance to 1e-3 and set the parameter bounds, the optimization does not do anything and cost does not change:
Solver Summary (v 2.1.0-eigen-(3.4.0)-lapack-suitesparse-(7.0.0)-cxsparse-(4.0.3)-acceleratesparse-eigensparse-no_openmp)
Original Reduced
Parameter blocks 1 1
Parameters 3 3
Residual blocks 1407 1407
Residuals 4221 4221
Minimizer TRUST_REGION
Dense linear algebra library EIGEN
Trust region strategy LEVENBERG_MARQUARDT
Given Used
Linear solver DENSE_QR DENSE_QR
Threads 1 1
Linear solver ordering AUTOMATIC 1
Cost:
Initial 9.861525e+02
Final 9.861525e+02
Change 0.000000e+00
Minimizer iterations 1
Successful steps 1
Unsuccessful steps 0
Line search steps 0
Time (in seconds):
Preprocessor 0.000090
Residual only evaluation 0.004039 (1)
Line search cost evaluation 0.000000
Jacobian & residual evaluation 0.022044 (2)
Line search gradient evaluation 0.010126
Linear solver 0.000134 (1)
Line search polynomial minimization 0.000000
Minimizer 0.026335
Postprocessor 0.000007
Total 0.026432
Termination: CONVERGENCE (Parameter tolerance reached. Relative step_norm: 4.668004e-04 <= 1.000000e-03.)
If I remove the parameter bounds, I get two minimizer iterations and the cost does decrease. Since these are not true correspondences, the cost is obviously nonzero.
Solver Summary (v 2.1.0-eigen-(3.4.0)-lapack-suitesparse-(7.0.0)-cxsparse-(4.0.3)-acceleratesparse-eigensparse-no_openmp)
Original Reduced
Parameter blocks 1 1
Parameters 3 3
Residual blocks 1407 1407
Residuals 4221 4221
Minimizer TRUST_REGION
Dense linear algebra library EIGEN
Trust region strategy LEVENBERG_MARQUARDT
Given Used
Linear solver DENSE_QR DENSE_QR
Threads 1 1
Linear solver ordering AUTOMATIC 1
Cost:
Initial 9.861525e+02
Final 9.696417e+02
Change 1.651080e+01
Minimizer iterations 2
Successful steps 2
Unsuccessful steps 0
Time (in seconds):
Preprocessor 0.000111
Residual only evaluation 0.000177 (2)
Jacobian & residual evaluation 0.000633 (2)
Linear solver 0.000203 (2)
Minimizer 0.001200
Postprocessor 0.000010
Total 0.001321
Termination: CONVERGENCE (Parameter tolerance reached. Relative step_norm: 4.668086e-08 <= 1.000000e-03.)
If I keep the parameter bounds and drop the parameter and function tolerance down to 1e-6, I get the same result as with higher tolerance and no bounds:
Solver Summary (v 2.1.0-eigen-(3.4.0)-lapack-suitesparse-(7.0.0)-cxsparse-(4.0.3)-acceleratesparse-eigensparse-no_openmp)
Original Reduced
Parameter blocks 1 1
Parameters 3 3
Residual blocks 1407 1407
Residuals 4221 4221
Minimizer TRUST_REGION
Dense linear algebra library EIGEN
Trust region strategy LEVENBERG_MARQUARDT
Given Used
Linear solver DENSE_QR DENSE_QR
Threads 1 1
Linear solver ordering AUTOMATIC 1
Cost:
Initial 9.861525e+02
Final 9.696417e+02
Change 1.651080e+01
Minimizer iterations 2
Successful steps 2
Unsuccessful steps 0
Line search steps 0
Time (in seconds):
Preprocessor 0.000048
Residual only evaluation 0.000092 (2)
Line search cost evaluation 0.000000
Jacobian & residual evaluation 0.000570 (4)
Line search gradient evaluation 0.000251
Linear solver 0.000096 (2)
Line search polynomial minimization 0.000000
Minimizer 0.000859
Postprocessor 0.000005
Total 0.000912
Termination: CONVERGENCE (Parameter tolerance reached. Relative step_norm: 4.668100e-08 <= 1.000000e-06.)
I've attached the code that reproduces the problem (see lines 54-66). It has a long list of points at the end but is otherwise short.
Could someone explain this behaviour?