|Re: [eigen] New Levenberg Marquardt stuff|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [eigen] New Levenberg Marquardt stuff
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Sat, 8 Dec 2012 11:56:17 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=Hwg2WW6bE8HoakiH4k3f6ZmIt6aQwEtRZ8e1LzKsnLs=; b=ysbLCdmlMGmyh2em9DDb21DN2bRv1T7hlIst5nYjZcuxGFV104ANA9a6XsJ//lwM7o cJXCUgGOlJ7wZFY3iRs6lMsOlBlYXY5p8Ak/68Oa0uztGu3LrYxqvKPzLk+MLnQdJ9kn cEsmtPlf8qHIWuGat7VgmTU2I1zIHdsXDkSB8TtYBo1LygNEsXcESZQyDUJmzVBdv/eq +fneHvlFgdyWDO48znnhjzRDqkzx5nPOVSdtladgou3NzMrkGCXNSKA9d3/uIsUUNQgL Pno3HBvS48yaMRCCa7CFi7MNZnKAb/+G4Et/NoGyWntTiVDj1U1/UhNEyFNKDKtdUsJQ RBCQ==
Regarding the scope of Eigen, I think that restricting it to linear algebra only would be quite boring. I like to define Eigen as unified, simply to use numerical toolbox for scientists. Just like the Eigen's website says:
"Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms."
this obviously includes linear algebra, but not only. Of course, implementing the whole literature on non linear optimization algorithms would be overkill. Eigen should provide all the building blocks to enable users to quickly and elegantly implement their own customized high level solvers. However, there exist a few non-linear optimization procedures which are extremely frequent and parts of these "building blocks".. In my opinion, the LM algorithm is one of them, and I'm also thinking about LP and QP solvers.
Actually, with a good "base", such algorithms are much simpler than advanced sparse direct linear solvers. For these later, it would be out of the scope of Eigen to implement a full featured, parallel, CUDA-enabled sparse LU/Cholesky solver. Instead, we implemented more basic, but still quite efficient built-in versions together with wrappers to existing advanced solvers for advanced users.
For the few non-linear optimization algorithms that I'd like to see in Eigen, we could imagine the same approach: a built-in lightweight implementation that an Eigen user can learn and use in 5 minutes, together with wrappers to the most advanced external libraries. This way, one (e.g., a Matser/PhD student) can very quickly test his ideas and when comes the need of more advanced features, wrappers are available to assist him.
As long as the built-in non-linear solvers are very lightweights, I don't really see the need to create a new project for them. Recall that since Eigen is header only, as long as a user do not #include <Eigen/Sparse>, then the compiler will never see the sparse related code. So for him the presence of sparse code only occupies a few KB on his hard drive but has zero effect on the compilation time or size of his/her binaries. Same for any additional module.
It is also interesting to have a quick look at the sizes of some modules:
- Eigen (all): 3.7MB
- SparseLU: 164KB (compared to 2MB for the original SuperLU code, and Eigen's version is even faster)
- LevenbergMarquart: 40KB (ceres: 3.3MB, original cminpack: 500KB)
- Eigen's products (gemm, gemv, trmm, trsv, etc.): 356KB (much more than LM !!)