ZJU-FAST-Lab / LBFGS-Lite

LBFGS-Lite: A header-only L-BFGS unconstrained optimizer.
MIT License
320 stars 56 forks source link

-1008 error #1

Closed xiaoyuanzh closed 3 years ago

xiaoyuanzh commented 3 years ago

a rounding error occurred. no line search step satisfy the sufficient decrease and curvature condition. How to fix it?

ZhepeiWang commented 3 years ago

Rounding error usually occurs in two situations. The first one is that the gradient norm is already small enough considering the problem scale. The second one is that the provided gradient is not consistent with the function (usually incorrect gradient or failing in C2 assumption). To be honest, I almost always obtain such an error every time when I make mistakes on the gradient. I wonder if you can check the consistency, or provide the concrete form for objective function and its gradient to see if it is caused by possible underlying bugs.

xiaoyuanzh commented 3 years ago

it is very useful. I will check my gradient. I wonder the performance of numerical gradient?

ZhepeiWang commented 3 years ago

I'm afraid that I have no idea about the performance under numerical gradient (if finite difference is used). Numerical gradient, especially FD, can suffer from bad numerical condition. To partially handle such situations, the line search in this solver will automatically change to the trivial one instead of the More-Thunete one, of which the former is more robust in FD cases. However, these modifications are still tricks. I recommend you to use Complex Step or Automatic Differentiation to achieve better precision if possible.

ZhepeiWang commented 3 years ago

Close this issue. You may reopen it if further information.

xiaoyuanzh commented 3 years ago

hi, I have one more question. If we use, b spline optimization and uniform B spline. How we make sure that, the starting point and end point lies on the starting position and ending position of the robot?

ZhepeiWang commented 3 years ago

Sorry, personally, I do not prefer B spline in trajectory optimization for robot planning. As for this question, I cannot provide you some useful information. Maybe you can ask @bigsuperZZZX