-DCMAKE_BUILD_TYPE=Release
-DCXX11=ON
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
const int NROWS = 1645;const int NCOLS = 943;const int NBETAS = 5;const int DIMS = NROWS + NCOLS;const int TOT_DIMS = NBETAS * DIMS;
std::array<double, TOT_DIMS> k;std::array<double, TOT_DIMS> x;
struct Equations {
template <typename T> bool operator()(const T* const xx, T* eq) const { for (int i = 0; i < TOT_DIMS; i++) { eq[i] = T(-k[i]); } for (int beta_ix = 0; beta_ix < NBETAS; beta_ix++) { for (int i = 0; i < NROWS; i++) { for (int alpha = NROWS; alpha < DIMS; alpha++) { T zum = T(0.0); for (int bb = 0; bb < NBETAS; bb++) { zum += xx[i + bb * DIMS] * xx[alpha + bb * DIMS]; } T tt = xx[i + beta_ix * DIMS] * xx[alpha + beta_ix * DIMS] / (T(1.0) + zum); eq[i + beta_ix * DIMS] += tt; eq[alpha + beta_ix * DIMS] += tt; } } } return true; }};
Two suggestions.
Break each equation into it's own residual block. And with multiple threads you will get parallel evaluation or you should thread your cost functor itself.
Also, given then size of the parameters block, autodiff is going to be very slow because of heap allocations.
You are going to get much better performance by doing analytical derivatives.
Sameer
--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/868c2c62-3db9-426e-b4c4-3ce024d1be95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/e5a97efb-e3ae-40b6-8950-ff5f247de385%40googlegroups.com.
As for the Trust Region I tried again all of the linear solvers but I couldn't get anyone to go past the first iteration. And yeah probably the factorization of the jacobian is killing all the performance even though I managed to install SuiteSparse and set it all up on a bigger amazon ec2 instance and setting num_threads = 64 as well as num_linear_solver_threads = 64.
I'll keep playing with some of the parameters anyway! Thanks again for the answer, if you have any other suggestion (especially on the parameters to tweak) I'll give it a try!
--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/a306773f-ac67-47f7-8b85-e0e6dcac9df4%40googlegroups.com.
Giuseppe,Use either DENSE_QR or DENSE_NORMAL_CHOLESKY, with LAPACK as your dense_linear_algebra_library and make sure you are using a high quality threaded BLAS underneath, like gotoblas, openblas, ATLAS or intel MKL.SuiteSparse is of no use in this caseSameer
On Wed, Oct 18, 2017 at 3:27 PM 'Giuseppe Trapani' via Ceres Solver <ceres-...@googlegroups.com> wrote:
I did use all of the Line Search solvers but I haven't tweaked any parameter in particular. I'll see what I can do with the rank parameter you are saying, thanks for the suggestion!
As for the Trust Region I tried again all of the linear solvers but I couldn't get anyone to go past the first iteration. And yeah probably the factorization of the jacobian is killing all the performance even though I managed to install SuiteSparse and set it all up on a bigger amazon ec2 instance and setting num_threads = 64 as well as num_linear_solver_threads = 64.
I'll keep playing with some of the parameters anyway! Thanks again for the answer, if you have any other suggestion (especially on the parameters to tweak) I'll give it a try!
--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/a306773f-ac67-47f7-8b85-e0e6dcac9df4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/CABqdRUAT8g66Fh3zjm%3Du9NyKufGVYRYuooK7wvPL0qyDCRzfMA%40mail.gmail.com.To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver+unsubscribe@googlegroups.com.
Yes I used it already and it worked nicely, I was asking for the GradientChecker because I thought it was a class with some specific methods to access one block at a time or stuff like that!
Thanks again for the suggestion!
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/c84fba23-44cb-455a-8740-3c791b8f1fd0%40googlegroups.com.