[eigen] Re: Levenberg-Marquardt / Numerical differentiation

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi again, it seems to be that I misread the code. That is being done, so please ignore my last message. I will investigate further and let you know my conclusions. Sorry for the false alarm :S


On Fri, Oct 29, 2010 at 11:11 PM, Carlos Becker <carlosbecker@xxxxxxxxx> wrote:
Hi everyone again,
I began using the nonlinear optimization API (unsupported), so many special thanks to Thomas for his great job. I am also using the numeric differentiation module, and here comes my point: I was reading the book Multiple View Geometry and, on the chapter about iterative estimation, the authors mention that the delta used to calculate a numeric approximation to the derivative is usually chosen to be max( 1e-6, abs(1e-4 * xi) ), where xi means that the delta depends on the variable inside the parameter vector X.

Just to be more clear, we have a (generally) non-linear function F, Y = F(X), X = [x1 x2 x3 x4...]. What the authors mention is that d( F(X) ) / dX | X = Xa is to be calculated with a different delta for each variable in X, that follows the equation I cited above. The current code uses the same delta for every variable, which can be manually tuned..

I was trying to see if changing delta to be max( 1e-6, abs(1e-4 * xi) ) would change the result and it did. After doing that I get a smaller error ( sum(errors) ). Right now my sample code is a bit messy since I am using Eigen from matlab (mex files) and reading point correspondences from two images (stereo matching), but I could write a small testcase. In my case, total error is 9.148639e-03 with the current dev branch and 8.890057e-03 when I apply my small patch. Even though the difference may seem quite small, I can see the difference when I interpret the resulting data.

So, my question is if you (Thomas specially) think it would be worth to have an option to enable this behaviour, which may not be enabled by default. Unfortunately, I found no precise clue on the book about a paper where this variable-dependent delta is mentioned. According to the authors, these values came out empirically after many tests.

Best regards,
Carlos



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/