Re: [eigen] Levenberg-marquardt and dogleg minimizer |

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

*To*: Timothy Hunter <tjhunter@xxxxxxxxxxxx>*Subject*: Re: [eigen] Levenberg-marquardt and dogleg minimizer*From*: Keir Mierle <mierle@xxxxxxxxx>*Date*: Fri, 20 Feb 2009 15:21:35 -0800*Cc*: eigen <eigen@xxxxxxxxxxxxxxxxxxx>, libmv-devel <libmv-devel@xxxxxxxxxxxxxxxx>*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=l4K4Nxmn5y37gGh1mbceTseQAIOm4F5+vGapa2fhh2o=; b=iGqV/Jqai/yyanMOJ46ICl+8+iuzeGz9Vddml5SdfaBvqRAiCsiRnwZY31VXx2Yycg LzYmp9VEvfqinR9bslag8WOH5WcMo+8OC6getGWKFSYTvQx88V7ZqiOYxF1Uwkp7sSNZ dCCGv2JXOmplrGp2I0FRPc26cl4Q0hhXt3UBQ=*Domainkey-signature*: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=k4MrYp3sXgsDjcEsdGUD7DJRuEbp8WTABPP1k6QPWsFTxN51umrXvAuwhfBp5MPEEe EuxDRNZYNvjGnkR+MwHzZWkb2eO/Qyq+4rfqyWbN1+gxWTyOaksjlIyLl9ScJxU/M+6k PAJ6Th3mYXApvOQ6vhDOsjitGEBDIp72rhDnM=

On Fri, Feb 20, 2009 at 2:53 PM, Timothy Hunter <tjhunter@xxxxxxxxxxxx> wrote:

I have a failed attempt which is not posted going down the other path :)

This is a good idea, and as a bonus, will make calling code clearer, i.e.

NumericJacobian<MyFunc, CENTRAL_DIFFERENCE> instead of NumericJacobian<MyFunc, false>

I will make this change.

I agree that FMatrixType and XMatrixType are not great, but I am not convinced InputType and ReturnType are better. Arguably the return type is return type of the minimization, which is the same type as the parameters (x in this case) and not the type of f(x). Note that inside the LevenbergMarquardt class, I typedef things to Parameters and FVec. Again, not optimal. I will think about this more.

I'm open to better ideas.

Thanks for your suggestions!

Keir

Hello Keir,

thank you this post, it was a very interesting reading. I was trying to find a good way to represent the gradient and the hessian of a function for a convex solver, and I like your way of separating the jacobian from the function object itself.

I have a failed attempt which is not posted going down the other path :)

I have a few suggestions:

- in the Jacobian class, instead of having a boolean as a second template type, you may want a integer, so that different methods can be implemented in the future

This is a good idea, and as a bonus, will make calling code clearer, i.e.

NumericJacobian<MyFunc, CENTRAL_DIFFERENCE> instead of NumericJacobian<MyFunc, false>

I will make this change.

- in a function, the typenames XMatrixType and FMatrixType are not so obvious. Maybe InputType and ReturnType?

I agree that FMatrixType and XMatrixType are not great, but I am not convinced InputType and ReturnType are better. Arguably the return type is return type of the minimization, which is the same type as the parameters (x in this case) and not the type of f(x). Note that inside the LevenbergMarquardt class, I typedef things to Parameters and FVec. Again, not optimal. I will think about this more.

I'm open to better ideas.

Thanks for your suggestions!

Keir

Best regards

Timothy Hunter

--

On Thursday 19 February 2009 09:12:10 Keir Mierle wrote:

> The API for the LM implementation in libmv is more or less ready; since I

> plan to include it in Eigen at some point, I thought I'd send it along:

>

> http://code.google.com/p/libmv/source/browse/trunk/src/libmv/numeric/levenb

>erg_marquardt.h

> http://code.google.com/p/libmv/source/browse/trunk/src/libmv/numeric/levenb

>erg_marquardt_test.cc

>

> Mostly, I am looking for a review from an API perspective; also, I need to

> support sparse matrices at some point but don't have any experience with

> them; perhaps Gael could comment here as he is the sparse expert. In

> particular, I will need to support sparse Jacobians and solving sparse

> normal equations.

>

> I also have an implementation of Powell's dogleg method, which can be much

> faster than LM:

>

> http://code.google.com/p/libmv/source/browse/trunk/src/libmv/numeric/dogleg

>.h

> http://code.google.com/p/libmv/source/browse/trunk/src/libmv/numeric/dogleg

>_test.cc

>

> Keir

Timothy Hunter

Student (Stanford University)

T. 404 421 3075

**Follow-Ups**:**Re: [eigen] Levenberg-marquardt and dogleg minimizer***From:*Gael Guennebaud

**References**:**[eigen] Levenberg-marquardt and dogleg minimizer***From:*Keir Mierle

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] using eigen in OpenEmbedded/ ARM processor** - Next by Date:
**[eigen] Reshape function** - Previous by thread:
**[eigen] Levenberg-marquardt and dogleg minimizer** - Next by thread:
**Re: [eigen] Levenberg-marquardt and dogleg minimizer**

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