[eigen] Levenberg-Marquardt / Numerical differentiation |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Levenberg-Marquardt / Numerical differentiation
- From: Carlos Becker <carlosbecker@xxxxxxxxx>
- Date: Fri, 29 Oct 2010 23:11:28 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=X5dMJWwks8a6n9t4PMcSYIwG8fpQeamEi0BAD9xS1n4=; b=nQEKMJf4l+ijBW1KnVr+cNpwuMdN/FwTxC63zlJ9da9E2Ed5idFO8/kP3HNjsU0pFJ 9iQslLwhiCIRWkjIvTHfAomO+yM+fpBXLvE3rtwwDHPJpb3BeQwYfavvj0BUnV6kZusT T1y035kIZ54ar0+0fKOpjHa/G3v6HCbLFF3kc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=csdfWDzikjH6xNcfpCqOYYZ7WgAUlctNdihqAFmnY4K1rDEehjbUXBzs6AgckhyG0n 36chsGQ8Oum3O7y3iHUUQqDPFrYb0j2TbMxFic5BjQl6IOMAOmpBw0KSpPZ3gwyS4XGZ 8gIkVDobARLfZV3lVMSFIm+jHaKymU89pUQ0Y=
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