Ceres Solver Evaluate error

220 views
Skip to first unread message

zichen Zhang

unread,
Jun 25, 2022, 11:31:58 PM6/25/22
to ceres-...@googlegroups.com
I use Evaluate() to build Jacobian. The problems that exist after the optimization iteration is over are shown in Figure 1 below. That is, only the 0th iteration calculates the Jacobian, and the rest of the iterations are not calculated, and the Initial cost is equal to the Final cost. Figure 2 shows that only one of the iterative steps succeeds and the rest fail. I don't know what is causing this error, so I put my Evaluate in Figure 3.
8AFB2594-3723-4B10-85C0-6C2881EAC593.png
62276ED5-E525-4C45-AAB0-FD838557E1AC.png
6A69CA22-C078-45EB-B1CE-3284263A2300.png

Sameer Agarwal

unread,
Jun 26, 2022, 1:27:49 AM6/26/22
to ceres-...@googlegroups.com
The ceres display/logs are a bit confusing but there is nothing wrong with your jacobian evaluation. 
What is actually happening is that the solver is not able to make any progress, it tries smaller and smaller trust region radii (larger and larger LM damping) and is still not able to find a solution that will reduce the error.
you are either in a local minimum or in a really poorly conditioned region of the parameter space.
you can see this by observing the cost values being computed and the decreasing values of tr_radius.
you could try reducing parameter_tolerance to see if it helps but I doubt it.
I think something about your problem formulation needs to change.
Sameer


On Sat, Jun 25, 2022 at 8:31 PM zichen Zhang <zwl9...@gmail.com> wrote:
I use Evaluate() to build Jacobian. The problems that exist after the optimization iteration is over are shown in Figure 1 below. That is, only the 0th iteration calculates the Jacobian, and the rest of the iterations are not calculated, and the Initial cost is equal to the Final cost. Figure 2 shows that only one of the iterative steps succeeds and the rest fail. I don't know what is causing this error, so I put my Evaluate in Figure 3.

--
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/CAFGt0eP%3DjcsK1OxSoBR704VtpHxxOT6PFsvShuu3ru6u1kB6KQ%40mail.gmail.com.

zichen Zhang

unread,
Jun 26, 2022, 3:09:51 AM6/26/22
to ceres-...@googlegroups.com
Thanks very much for your answer. I once also suspected that I was in a local minimum, that is, the initial value of my state may be set more accurately. But when I try to change the initial value of my state to 0, the error still occurs. I also suspected that it was because my Weight settings were unreasonable, but that didn't make much of a difference. It is worth noting that the gradient of the 1st iteration in Figure 1 is not the gradient of the 0th iteration, because the Cost change of the 1st iteration makes the Cost larger again. In addition, when the iteration ends and stops, the error is still the error at the beginning of the iteration. All these are affected by the fact that the Jacobian is calculated only once at the 0th iteration .I don't know what you mean by changing the formulation of the my problem  at the end?
在 2022年6月26日星期日,'Sameer Agarwal' via Ceres Solver <ceres-...@googlegroups.com> 写道:
The ceres display/logs are a bit confusing but there is nothing wrong with your jacobian evaluation. 
What is actually happening is that the solver is not able to make any progress, it tries smaller and smaller trust region radii (larger and larger LM damping) and is still not able to find a solution that will reduce the error.
you are either in a local minimum or in a really poorly conditioned region of the parameter space.
you can see this by observing the cost values being computed and the decreasing values of tr_radius.
you could try reducing parameter_tolerance to see if it helps but I doubt it.
I think something about your problem formulation needs to change.
Sameer


On Sat, Jun 25, 2022 at 8:31 PM zichen Zhang <zwl9...@gmail.com> wrote:
I use Evaluate() to build Jacobian. The problems that exist after the optimization iteration is over are shown in Figure 1 below. That is, only the 0th iteration calculates the Jacobian, and the rest of the iterations are not calculated, and the Initial cost is equal to the Final cost. Figure 2 shows that only one of the iterative steps succeeds and the rest fail. I don't know what is causing this error, so I put my Evaluate in Figure 3.

--
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+unsubscribe@googlegroups.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/CABqdRUDG%2BSQC%2Bxk9FJm7goJhKO3wR8Oo4EkPFGwmsYiPLddXrg%40mail.gmail.com.

Sameer Agarwal

unread,
Jun 27, 2022, 4:10:24 PM6/27/22
to ceres-...@googlegroups.com
Zichen,
There is no error. The gradient being reported as zero is a logging peculiarity of ceres. since the cost is larger than the cost at iteration 0, we do not evaluate the jacobian, and just report it as zero. we should likely change this to be clearer.  So what is happening here is that the algorithm is unable to make any progress from its starting point, even the smallest step it takes causes the cost to increase.

I recommend you look into the meaning of the term "poorly conditioned problem" 

Sameer


On Sun, Jun 26, 2022 at 12:09 AM zichen Zhang <zwl9...@gmail.com> wrote:
Thanks very much for your answer. I once also suspected that I was in a local minimum, that is, the initial value of my state may be set more accurately. But when I try to change the initial value of my state to 0, the error still occurs. I also suspected that it was because my Weight settings were unreasonable, but that didn't make much of a difference. It is worth noting that the gradient of the 1st iteration in Figure 1 is not the gradient of the 0th iteration, because the Cost change of the 1st iteration makes the Cost larger again. In addition, when the iteration ends and stops, the error is still the error at the beginning of the iteration. All these are affected by the fact that the Jacobian is calculated only once at the 0th iteration .I don't know what you mean by changing the formulation of the my problem  at the end?
在 2022年6月26日星期日,'Sameer Agarwal' via Ceres Solver <ceres-...@googlegroups.com> 写道:
The ceres display/logs are a bit confusing but there is nothing wrong with your jacobian evaluation. 
What is actually happening is that the solver is not able to make any progress, it tries smaller and smaller trust region radii (larger and larger LM damping) and is still not able to find a solution that will reduce the error.
you are either in a local minimum or in a really poorly conditioned region of the parameter space.
you can see this by observing the cost values being computed and the decreasing values of tr_radius.
you could try reducing parameter_tolerance to see if it helps but I doubt it.
I think something about your problem formulation needs to change.
Sameer


On Sat, Jun 25, 2022 at 8:31 PM zichen Zhang <zwl9...@gmail.com> wrote:
I use Evaluate() to build Jacobian. The problems that exist after the optimization iteration is over are shown in Figure 1 below. That is, only the 0th iteration calculates the Jacobian, and the rest of the iterations are not calculated, and the Initial cost is equal to the Final cost. Figure 2 shows that only one of the iterative steps succeeds and the rest fail. I don't know what is causing this error, so I put my Evaluate in Figure 3.

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

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

--
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/CAFGt0eMyoHiuktbn6mfkV0Yq0Z2Z-XO0O%2BQyN%2BW9KtKGbFStbw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages