Re: [math] refactoring least squares

2014-02-25 Thread Ted Dunning
On Tue, Feb 25, 2014 at 8:39 AM, luc wrote: > Also, I think testing should be done on an actual large problem where >>> scaling issuing would show up. The 1000x2 jaccobian would results in a >>> 2x2 >>> normal equation. Surely this is not a good test case. >>> >>> Konstantin >>> >>> >> As you poi

Re: [math] refactoring least squares

2014-02-25 Thread luc
Hi Ted, Le 2014-02-25 15:42, Ted Dunning a écrit : On Tue, Feb 25, 2014 at 6:22 AM, Konstantin Berlin wrote: Hi, I am really having problems believing that matrix copying is the major problem in an optimization algorithm. Copying is O(N^2) operations. Surely, for any problem where performan

Re: [math] refactoring least squares

2014-02-25 Thread Ted Dunning
On Tue, Feb 25, 2014 at 6:22 AM, Konstantin Berlin wrote: > Hi, > > I am really having problems believing that matrix copying is the major > problem in an optimization algorithm. Copying is O(N^2) operations. Surely, > for any problem where performance would matter, it is completely dwarfed by > t

Re: [math] refactoring least squares

2014-02-25 Thread Konstantin Berlin
Hi, I am really having problems believing that matrix copying is the major problem in an optimization algorithm. Copying is O(N^2) operations. Surely, for any problem where performance would matter, it is completely dwarfed by the O(N^3) complexity of actually solving the normal equation. Also, I

Re: [math] refactoring least squares

2014-02-25 Thread Evan Ward
On 02/24/2014 05:47 PM, Gilles wrote: > On Mon, 24 Feb 2014 14:41:34 -0500, Evan Ward wrote: >> On 02/24/2014 01:23 PM, Gilles wrote: >>> On Mon, 24 Feb 2014 11:49:26 -0500, Evan Ward wrote: One way to improve performance would be to provide pre-allocated space for the Jacobian and reuse

Re: [math] refactoring least squares

2014-02-24 Thread Gilles
On Mon, 24 Feb 2014 14:41:34 -0500, Evan Ward wrote: On 02/24/2014 01:23 PM, Gilles wrote: On Mon, 24 Feb 2014 11:49:26 -0500, Evan Ward wrote: One way to improve performance would be to provide pre-allocated space for the Jacobian and reuse it for each evaluation. Do you have actual data to

Re: [math] refactoring least squares

2014-02-24 Thread Evan Ward
On 02/24/2014 02:18 PM, Ted Dunning wrote: > > On Mon, Feb 24, 2014 at 10:23 AM, Gilles > wrote: > > One way to improve performance would be to provide > pre-allocated space > for the Jacobian and reuse it for each evaluation. > > >

Re: [math] refactoring least squares

2014-02-24 Thread Evan Ward
On 02/24/2014 01:23 PM, Gilles wrote: > On Mon, 24 Feb 2014 11:49:26 -0500, Evan Ward wrote: >> One way to improve performance would be to provide pre-allocated space >> for the Jacobian and reuse it for each evaluation. > > Do you have actual data to back this statement? I did some tests with th

Re: [math] refactoring least squares

2014-02-24 Thread Ted Dunning
On Mon, Feb 24, 2014 at 10:23 AM, Gilles wrote: > One way to improve performance would be to provide pre-allocated space >> for the Jacobian and reuse it for each evaluation. >> > > Do you have actual data to back this statement? > > > The >> LeastSquaresProblem interface would then be: >> >> voi

Re: [math] refactoring least squares

2014-02-24 Thread Gilles
On Mon, 24 Feb 2014 11:49:26 -0500, Evan Ward wrote: I've looked into improving performance further, but it seems any further improvements will need big API changes for memory management. Currently using Gauss-Newton with Cholesky (or LU) requires 4 matrix allocations _each_ evaluation. The obj

Re: [math] refactoring least squares

2014-02-24 Thread Gilles
On Mon, 24 Feb 2014 18:09:26 +0100, Luc Maisonobe wrote: Hi Evan, Le 24/02/2014 17:49, Evan Ward a écrit : I've looked into improving performance further, but it seems any further improvements will need big API changes for memory management. Currently using Gauss-Newton with Cholesky (or LU)

Re: [math] refactoring least squares

2014-02-24 Thread Luc Maisonobe
Hi Evan, Le 24/02/2014 17:49, Evan Ward a écrit : > I've looked into improving performance further, but it seems any further > improvements will need big API changes for memory management. > > Currently using Gauss-Newton with Cholesky (or LU) requires 4 matrix > allocations _each_ evaluation. Th

Re: [math] refactoring least squares

2014-02-24 Thread Evan Ward
I've looked into improving performance further, but it seems any further improvements will need big API changes for memory management. Currently using Gauss-Newton with Cholesky (or LU) requires 4 matrix allocations _each_ evaluation. The objective function initially allocates the Jacobian matrix.

Re: [math] refactoring least squares

2014-02-20 Thread Gilles
Hi. [...] I recall that we did not want "...Impl" classes. Is another implementation foreseen? [...] As for the Impl classes, theses are package private implementations of interfaces, so the users won't see the name. For the LeastSquareProblem interface I could see a lazy evaluation imp

Re: [math] refactoring least squares

2014-02-20 Thread Evan Ward
On Thu 20 Feb 2014 08:34:19 AM EST, Gilles wrote: > > Hi. > > On Thu, 20 Feb 2014 10:05:58 +0100, luc wrote: >> >> Hi all, >> >> I am looking more precisely at the least squares package and have a >> few adjustments to propose. >> >> The Evaluation interface declares a computeValue and a >> compu

Re: [math] refactoring least squares

2014-02-20 Thread Gilles
Hi. On Thu, 20 Feb 2014 10:05:58 +0100, luc wrote: Hi all, I am looking more precisely at the least squares package and have a few adjustments to propose. The Evaluation interface declares a computeValue and a computeJacobian method among others. However, it seems the implementations are reall

Re: [math] refactoring least squares

2014-02-20 Thread Thomas Neidhart
On Thu, Feb 20, 2014 at 10:05 AM, luc wrote: > Hi all, > > I am looking more precisely at the least squares package and have a few > adjustments to propose. > > The Evaluation interface declares a computeValue and a computeJacobian > method among others. > However, it seems the implementations ar

[math] refactoring least squares

2014-02-20 Thread luc
Hi all, I am looking more precisely at the least squares package and have a few adjustments to propose. The Evaluation interface declares a computeValue and a computeJacobian method among others. However, it seems the implementations are really simply built with the precomputed values and ju

Re: [math] refactoring least squares

2014-02-19 Thread Luc Maisonobe
Le 18/02/2014 23:57, Evan Ward a écrit : > > On 02/18/2014 09:51 AM, luc wrote: >> Hi all, >> >> As you have probably noticed, I have committed the changes proposed by >> Evan. This ends up to about 20 different commits, >> as I have tried to stick with the progressive changes he made in his >> Gi

Re: [math] refactoring least squares

2014-02-18 Thread Evan Ward
On 02/18/2014 09:51 AM, luc wrote: > Hi all, > > As you have probably noticed, I have committed the changes proposed by > Evan. This ends up to about 20 different commits, > as I have tried to stick with the progressive changes he made in his > Github repository. Some of the initial commits > do n

[math] refactoring least squares

2014-02-18 Thread luc
Hi all, As you have probably noticed, I have committed the changes proposed by Evan. This ends up to about 20 different commits, as I have tried to stick with the progressive changes he made in his Github repository. Some of the initial commits do not abide by our development rules (missing Apa