patrikhuber / superviseddescent

C++11 implementation of the supervised descent optimisation method
http://patrikhuber.github.io/superviseddescent/
Apache License 2.0
402 stars 188 forks source link

eigen function runs very slow #41

Closed ardeal closed 7 years ago

ardeal commented 7 years ago

Hi Prof., I run your code to train the model. however, when I run the funtion solve in VerbosePartialPivLUSolver class, the following code runs very slow:

RowMajorMatrixXf AtA_Eigen = A_Eigen.transpose() * A_Eigen;

A_Eigen matxi is 20*8801. it means that to do the transpose of matrix it needs 76588ms which is a very big value. my system configurations are: windowns10, CPU Intel i5-6200U, RAM 8G.

the QR of matrix cannot be finished at all in the solve function.

Do you have any idea about this issue?

ardeal commented 7 years ago

Hi Patrikhuber I just now confirmed that the reason why eigen function is slow is that the matrix multiplication on Eigen lib is very slow on my VS2015

Do you have any idea about the reason?

ardeal commented 7 years ago

Hi Hi Patrikhuber,

Thanks any way! I found out the reason of this issue: we should enable O2 optimization on VS otherwise eigen functions run very slow.

patrikhuber commented 7 years ago

O2 should be enabled by default actually if you use the VS generator and do a Release build in VS. Glad you found out.