Re: [eigen] Really weird regression / product selection logic

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


it seems this is a side effect of some other issues as reported by valgrind:

==13622== Command: ./NonLinearOptimization_3                                               
==13622==                                                                                  
Initializing random number generator with seed 1271450769                                  
Repeating each test 10 times                                                               
==13622== Conditional jump or move depends on uninitialised value(s)                       
==13622==    at 0x53262E: void Eigen::ei_rwupdt<double>(Eigen::Matrix<double, 33331, 33331, 0, 33331, 33331>&, Eigen::Matrix<double, 33331, 1, 0, 33331, 1> const&, Eigen::Matrix<double, 33331, 1, 0, 33331, 1>&, double) (rwupdt.h:28)                                                                                                         
==13622==    by 0x51790B: Eigen::LevenbergMarquardt<lmstr_functor, double>::minimizeOptimumStorageOneStep(Eigen::Matrix<double, 33331, 1, 0, 33331, 1>&) (LevenbergMarquardt.h:450)                                                                                                                                                              
==13622==    by 0x50EC38: Eigen::LevenbergMarquardt<lmstr_functor, double>::minimizeOptimumStorage(Eigen::Matrix<double, 33331, 1, 0, 33331, 1>&) (LevenbergMarquardt.h:616)                                                                                                                                                                     
==13622==    by 0x50EBF0: Eigen::LevenbergMarquardt<lmstr_functor, double>::lmstr1(Eigen::Matrix<double, 33331, 1, 0, 33331, 1>&, double) (LevenbergMarquardt.h:380)    
==13622==    by 0x4E93B4: testLmstr1() (NonLinearOptimization.cpp:480)                                                                                                  
==13622==    by 0x4F8B2C: test_NonLinearOptimization() (NonLinearOptimization.cpp:1813)                                                                                 
==13622==    by 0x4E5B61: main (main.h:541)                                                                                                                             
==13622==                                                                                                                                                               
==13622== Conditional jump or move depends on uninitialised value(s)                                                                                                    
==13622==    at 0x532630: void Eigen::ei_rwupdt<double>(Eigen::Matrix<double, 33331, 33331, 0, 33331, 33331>&, Eigen::Matrix<double, 33331, 1, 0, 33331, 1> const&, Eigen::Matrix<double, 33331, 1, 0, 33331, 1>&, double) (rwupdt.h:28)                                                                                                         
==13622==    by 0x51790B: Eigen::LevenbergMarquardt<lmstr_functor, double>::minimizeOptimumStorageOneStep(Eigen::Matrix<double, 33331, 1, 0, 33331, 1>&) (LevenbergMarquardt.h:450)                                                                                                                                                              
==13622==    by 0x50EC38: Eigen::LevenbergMarquardt<lmstr_functor, double>::minimizeOptimumStorage(Eigen::Matrix<double, 33331, 1, 0, 33331, 1>&) (LevenbergMarquardt.h:616)                                                                                                                                                                     
==13622==    by 0x50EBF0: Eigen::LevenbergMarquardt<lmstr_functor, double>::lmstr1(Eigen::Matrix<double, 33331, 1, 0, 33331, 1>&, double) (LevenbergMarquardt.h:380)    
==13622==    by 0x4E93B4: testLmstr1() (NonLinearOptimization.cpp:480)                                                                                                  
==13622==    by 0x4F8B2C: test_NonLinearOptimization() (NonLinearOptimization.cpp:1813)                                                                                 
==13622==    by 0x4E5B61: main (main.h:541)

[...]

the list is very long.

gael

On Fri, Apr 16, 2010 at 7:19 PM, Thomas Capricelli <orzel@xxxxxxxxxxxxxxx> wrote:

(Mainly for Gael i think)

I've just noticed that the NonLinear tests do not pass anymore. I've bissected the problem up to this 3-line patch:
http://bitbucket.org/eigen/eigen/changeset/f5be9bf9e965

I confirm that reverting this patch brings back all the NonLinear tests.

Unfortunately, I dont really understand what's going on.  Let me try to explain what happens from my tests point of view (check the excerpt copy/pasted at the end).
Among other things, i test the 'nfev', which is the 'number of function evaluation', which is a rough estimatiom of the number of steps performed by the algorithm. The lesser the better of course. It can slightly change depending on the floating point size or implementation (processor). Another reason why it can change is when underlying algorithms (QR, matrix products...) change, because of precision-related behaviour, but even then, only slightly. What i've posted shows a uniform non-trivial regression in the number of steps needed, sometimes more than two times as much steps. (yes, in one case it is actually better, this is weird, i agree).

I also test the value for 'info', which reports the reason that made the algorithm stop. There, too, it might change slightly (== for very few tests) for misc reasons, but in this case it's almost always stopping for a worse reason than before (yes, there are reasons better than others, '1' is good)

So my conclusion is that the underlying stuff in eigen (the nonlinear module is mostly 'using' eigen) is performing a lot less well now than before, but i can't really say how/why. I'm not even sure this patch is the 'real' reason.

Also, I have no idea if this is a useful test, but if I use the following lines (max only used for Depth, not for Rows/Cols)
   Rows  = _Lhs::RowsAtCompileTime,
   Cols  = _Rhs::ColsAtCompileTime,
   Depth = EIGEN_ENUM_MIN(_Lhs::MaxColsAtCompileTime,_Rhs::MaxRowsAtCompileTime)
Then all tests pass again.

regards,
Thomas
--
Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>
http://www.freehackers.org/thomas


Initializing random number generator with seed 1271436940
Repeating each test 10 times
info, nfev, njev : 2, 12, 6

   actual   = 12
   expected = 6

Test testLmder1() failed in "/home/orzel/hg/eigen/unsupported/test/NonLinearOptimization.cpp" (176)
   test_is_equal(lm.nfev, 6)

   actual   = 36
   expected = 26

Test testLmdif1() failed in "/home/orzel/hg/eigen/unsupported/test/NonLinearOptimization.cpp" (568)
   test_is_equal(nfev, 26)

Initializing random number generator with seed 1271436940
Repeating each test 10 times

   actual   = 24
   expected = 19

Test testNistMisra1a() failed in "/home/orzel/hg/eigen/unsupported/test/NonLinearOptimization.cpp" (764)
   test_is_equal(lm.nfev, 19)

Initializing random number generator with seed 1271436940
Repeating each test 10 times

   actual   = 27
   expected = 11

Test testNistHahn1() failed in "/home/orzel/hg/eigen/unsupported/test/NonLinearOptimization.cpp" (850)
   test_is_equal(lm.nfev, 11)

Initializing random number generator with seed 1271436940
Repeating each test 10 times

   actual   = 19
   expected = 10

Test testNistRat42() failed in "/home/orzel/hg/eigen/unsupported/test/NonLinearOptimization.cpp" (1100)
   test_is_equal(lm.nfev, 10)

Initializing random number generator with seed 1271436940
Repeating each test 10 times

   actual   = 20
   expected = 31

Test testNistBoxBOD() failed in "/home/orzel/hg/eigen/unsupported/test/NonLinearOptimization.cpp" (1257)
   test_is_equal(lm.nfev, 31)

Initializing random number generator with seed 1271436940
Repeating each test 10 times

   actual   = 1000
   expected = 758

Test testNistBennett5() failed in "/home/orzel/hg/eigen/unsupported/test/NonLinearOptimization.cpp" (1509)
   test_is_equal(lm.nfev, 758)

Initializing random number generator with seed 1271436940
Repeating each test 10 times

   actual   = 36
   expected = 27

Test testNistRat43() failed in "/home/orzel/hg/eigen/unsupported/test/NonLinearOptimization.cpp" (1689)
   test_is_equal(lm.nfev, 27)





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