[eigen] Really weird regression / product selection logic |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
(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)