-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor multigrid_ndt_omp #32
Conversation
Signed-off-by: anhnv3991 <[email protected]>
Signed-off-by: anhnv3991 <[email protected]>
@anhnv3991 If possible, I think it's a good idea to submit only pure refactoring parts where there are no differences in the results as a separate pull request. 🦭 |
@SakodaShintaro I guess the difference is caused by the change from float to double. I'll remove float to double change tomorrow. |
Signed-off-by: Shintaro Sakoda <[email protected]>
Signed-off-by: Shintaro Sakoda <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -681,7 +645,7 @@ void pclomp::MultiGridNormalDistributionsTransform<PointSource, PointTarget>::co | |||
|
|||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
template<typename PointSource, typename PointTarget> | |||
void pclomp::MultiGridNormalDistributionsTransform<PointSource, PointTarget>::updateHessian(Eigen::Matrix<double, 6, 6> &hessian, const Eigen::Matrix<double, 3, 6> &point_gradient, const Eigen::Matrix<double, 18, 6> &point_hessian, const Eigen::Vector3d &x_trans, const Eigen::Matrix3d &c_inv) const { | |||
void pclomp::MultiGridNormalDistributionsTransform<PointSource, PointTarget>::updateHessian(Eigen::Matrix<double, 6, 6> &hessian, const Eigen::Matrix<double, 4, 6> &point_gradient, const Eigen::Matrix<double, 24, 6> &point_hessian, const Eigen::Vector3d &x_trans, const Eigen::Matrix3d &c_inv) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let me confirm my understanding.
updateHessian is only used from computeHessian, and computeHessian is only used in the following lines.
if(step_iterations) computeHessian(hessian, trans_cloud, x_t); |
This is a branch when something is updated in line_search, and since line_search is currently turned off, step_iteration is always 0, so I don't think computeHessian will be called.
Is my understanding correct?
In other words, even if there is a bug in updateHessian, it will not be noticed in its current behavior, and I am concerned that it will occur someday when line_search is turned on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SakodaShintaro If the line search is turned on, errors will 100% occur. It is because the angular derivatives (j_ang_a_, j_ang_b, etc) are not pre-computed. Those variables are used by the computeHessian.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anhnv3991
I would like to maintain line_search to be able to use.
Steps
(1) Organize parameters: this PR #43
(2) Add a bool type parameter called use_line_search and make it possible to switch true/false: next PR #46
(3) I would like to merge this PR while maintaining a buildable state.
Signed-off-by: anhnv3991 <[email protected]>
Signed-off-by: anhnv3991 <[email protected]>
Signed-off-by: anhnv3991 <[email protected]>
Signed-off-by: anhnv3991 <[email protected]>
* Organized ndt params Signed-off-by: Shintaro Sakoda <[email protected]> * style(pre-commit): autofix --------- Signed-off-by: Shintaro Sakoda <[email protected]> Co-authored-by: SakodaShintaro <[email protected]>
* Coding Signed-off-by: anhnv3991 <[email protected]> * Rearrange the code to avoid duplicated processing Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * Updated reference/result.csv Signed-off-by: Shintaro Sakoda <[email protected]> * A minor fix Signed-off-by: Shintaro Sakoda <[email protected]> * refactor: organized ndt params (#43) * Organized ndt params Signed-off-by: Shintaro Sakoda <[email protected]> * style(pre-commit): autofix --------- Signed-off-by: Shintaro Sakoda <[email protected]> Co-authored-by: SakodaShintaro <[email protected]> * Coding Signed-off-by: anhnv3991 <[email protected]> * Fixed conflicts after rebasing Signed-off-by: anhnv3991 <[email protected]> * Coding Signed-off-by: anhnv3991 <[email protected]> * Coding Signed-off-by: anhnv3991 <[email protected]> * Fixed some bugs Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * Fixed to run workflow Signed-off-by: Shintaro Sakoda <[email protected]> --------- Signed-off-by: anhnv3991 <[email protected]> Signed-off-by: Shintaro Sakoda <[email protected]> Co-authored-by: anhnv3991 <[email protected]> Co-authored-by: Shintaro Sakoda <[email protected]> Co-authored-by: SakodaShintaro <[email protected]> Co-authored-by: SakodaShintaro <[email protected]>
* Added tp_score to regression_test Signed-off-by: Shintaro Sakoda <[email protected]> * Updated result.csv by result of GitHub Actions Signed-off-by: Shintaro Sakoda <[email protected]> * Updated by the latest result Signed-off-by: Shintaro Sakoda <[email protected]> --------- Signed-off-by: Shintaro Sakoda <[email protected]>
* Added a parameter "use_line_search" Signed-off-by: Shintaro Sakoda <[email protected]> * Added default value use_line_search=false Signed-off-by: Shintaro Sakoda <[email protected]> --------- Signed-off-by: Shintaro Sakoda <[email protected]>
Signed-off-by: anhnv3991 <[email protected]>
Signed-off-by: anhnv3991 <[email protected]>
Signed-off-by: Shintaro Sakoda <[email protected]>
Signed-off-by: anhnv3991 <[email protected]>
Signed-off-by: anhnv3991 <[email protected]>
Signed-off-by: anhnv3991 <[email protected]>
Signed-off-by: anhnv3991 <[email protected]>
Signed-off-by: anhnv3991 <[email protected]>
Signed-off-by: anhnv3991 <[email protected]>
Signed-off-by: anhnv3991 <[email protected]>
Signed-off-by: Shintaro SAKODA <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SakodaShintaro Thanks a lot! |
* Refactoring multigrid_ndt_omp Signed-off-by: anhnv3991 <[email protected]> * Refactored multigrid_ndt_omp Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * Fixed to build Signed-off-by: Shintaro Sakoda <[email protected]> * Removed line breaks Signed-off-by: Shintaro Sakoda <[email protected]> * For reference, this should be discared later Signed-off-by: anhnv3991 <[email protected]> * Testing Signed-off-by: anhnv3991 <[email protected]> * Clean up a bit Signed-off-by: anhnv3991 <[email protected]> * Clean up a bit Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * refactor: organized ndt params (#43) * Organized ndt params Signed-off-by: Shintaro Sakoda <[email protected]> * style(pre-commit): autofix --------- Signed-off-by: Shintaro Sakoda <[email protected]> Co-authored-by: SakodaShintaro <[email protected]> * Speed up multigrid NDT align (#41) * Coding Signed-off-by: anhnv3991 <[email protected]> * Rearrange the code to avoid duplicated processing Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * Updated reference/result.csv Signed-off-by: Shintaro Sakoda <[email protected]> * A minor fix Signed-off-by: Shintaro Sakoda <[email protected]> * refactor: organized ndt params (#43) * Organized ndt params Signed-off-by: Shintaro Sakoda <[email protected]> * style(pre-commit): autofix --------- Signed-off-by: Shintaro Sakoda <[email protected]> Co-authored-by: SakodaShintaro <[email protected]> * Coding Signed-off-by: anhnv3991 <[email protected]> * Fixed conflicts after rebasing Signed-off-by: anhnv3991 <[email protected]> * Coding Signed-off-by: anhnv3991 <[email protected]> * Coding Signed-off-by: anhnv3991 <[email protected]> * Fixed some bugs Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * Fixed to run workflow Signed-off-by: Shintaro Sakoda <[email protected]> --------- Signed-off-by: anhnv3991 <[email protected]> Signed-off-by: Shintaro Sakoda <[email protected]> Co-authored-by: anhnv3991 <[email protected]> Co-authored-by: Shintaro Sakoda <[email protected]> Co-authored-by: SakodaShintaro <[email protected]> Co-authored-by: SakodaShintaro <[email protected]> * fix: add tp to regression test (#44) * Added tp_score to regression_test Signed-off-by: Shintaro Sakoda <[email protected]> * Updated result.csv by result of GitHub Actions Signed-off-by: Shintaro Sakoda <[email protected]> * Updated by the latest result Signed-off-by: Shintaro Sakoda <[email protected]> --------- Signed-off-by: Shintaro Sakoda <[email protected]> * fix: add a param use line search (#46) * Added a parameter "use_line_search" Signed-off-by: Shintaro Sakoda <[email protected]> * Added default value use_line_search=false Signed-off-by: Shintaro Sakoda <[email protected]> --------- Signed-off-by: Shintaro Sakoda <[email protected]> * Refactoring multigrid_ndt_omp Signed-off-by: anhnv3991 <[email protected]> * Refactored multigrid_ndt_omp Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * Removed line breaks Signed-off-by: Shintaro Sakoda <[email protected]> * For reference, this should be discared later Signed-off-by: anhnv3991 <[email protected]> * Testing Signed-off-by: anhnv3991 <[email protected]> * Clean up a bit Signed-off-by: anhnv3991 <[email protected]> * Clean up a bit Signed-off-by: anhnv3991 <[email protected]> * Debugging Signed-off-by: anhnv3991 <[email protected]> * Fixed a bug Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * Fixed build error Signed-off-by: anhnv3991 <[email protected]> * Updated result.csv Signed-off-by: Shintaro SAKODA <[email protected]> --------- Signed-off-by: anhnv3991 <[email protected]> Signed-off-by: Shintaro Sakoda <[email protected]> Signed-off-by: Shintaro SAKODA <[email protected]> Co-authored-by: anhnv3991 <[email protected]> Co-authored-by: SakodaShintaro <[email protected]> Co-authored-by: Shintaro Sakoda <[email protected]> Co-authored-by: SakodaShintaro <[email protected]>
* Coding Signed-off-by: anhnv3991 <[email protected]> * Rearrange the code to avoid duplicated processing Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * Added multithread voxel grid build Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * Fixed Signed-off-by: anhnv3991 <[email protected]> * Fixed wrong tmp_score usage Signed-off-by: anhnv3991 <[email protected]> * Refactor multigrid_ndt_omp (#32) * Refactoring multigrid_ndt_omp Signed-off-by: anhnv3991 <[email protected]> * Refactored multigrid_ndt_omp Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * Fixed to build Signed-off-by: Shintaro Sakoda <[email protected]> * Removed line breaks Signed-off-by: Shintaro Sakoda <[email protected]> * For reference, this should be discared later Signed-off-by: anhnv3991 <[email protected]> * Testing Signed-off-by: anhnv3991 <[email protected]> * Clean up a bit Signed-off-by: anhnv3991 <[email protected]> * Clean up a bit Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * refactor: organized ndt params (#43) * Organized ndt params Signed-off-by: Shintaro Sakoda <[email protected]> * style(pre-commit): autofix --------- Signed-off-by: Shintaro Sakoda <[email protected]> Co-authored-by: SakodaShintaro <[email protected]> * Speed up multigrid NDT align (#41) * Coding Signed-off-by: anhnv3991 <[email protected]> * Rearrange the code to avoid duplicated processing Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * Updated reference/result.csv Signed-off-by: Shintaro Sakoda <[email protected]> * A minor fix Signed-off-by: Shintaro Sakoda <[email protected]> * refactor: organized ndt params (#43) * Organized ndt params Signed-off-by: Shintaro Sakoda <[email protected]> * style(pre-commit): autofix --------- Signed-off-by: Shintaro Sakoda <[email protected]> Co-authored-by: SakodaShintaro <[email protected]> * Coding Signed-off-by: anhnv3991 <[email protected]> * Fixed conflicts after rebasing Signed-off-by: anhnv3991 <[email protected]> * Coding Signed-off-by: anhnv3991 <[email protected]> * Coding Signed-off-by: anhnv3991 <[email protected]> * Fixed some bugs Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * Fixed to run workflow Signed-off-by: Shintaro Sakoda <[email protected]> --------- Signed-off-by: anhnv3991 <[email protected]> Signed-off-by: Shintaro Sakoda <[email protected]> Co-authored-by: anhnv3991 <[email protected]> Co-authored-by: Shintaro Sakoda <[email protected]> Co-authored-by: SakodaShintaro <[email protected]> Co-authored-by: SakodaShintaro <[email protected]> * fix: add tp to regression test (#44) * Added tp_score to regression_test Signed-off-by: Shintaro Sakoda <[email protected]> * Updated result.csv by result of GitHub Actions Signed-off-by: Shintaro Sakoda <[email protected]> * Updated by the latest result Signed-off-by: Shintaro Sakoda <[email protected]> --------- Signed-off-by: Shintaro Sakoda <[email protected]> * fix: add a param use line search (#46) * Added a parameter "use_line_search" Signed-off-by: Shintaro Sakoda <[email protected]> * Added default value use_line_search=false Signed-off-by: Shintaro Sakoda <[email protected]> --------- Signed-off-by: Shintaro Sakoda <[email protected]> * Refactoring multigrid_ndt_omp Signed-off-by: anhnv3991 <[email protected]> * Refactored multigrid_ndt_omp Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * Removed line breaks Signed-off-by: Shintaro Sakoda <[email protected]> * For reference, this should be discared later Signed-off-by: anhnv3991 <[email protected]> * Testing Signed-off-by: anhnv3991 <[email protected]> * Clean up a bit Signed-off-by: anhnv3991 <[email protected]> * Clean up a bit Signed-off-by: anhnv3991 <[email protected]> * Debugging Signed-off-by: anhnv3991 <[email protected]> * Fixed a bug Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * Fixed build error Signed-off-by: anhnv3991 <[email protected]> * Updated result.csv Signed-off-by: Shintaro SAKODA <[email protected]> --------- Signed-off-by: anhnv3991 <[email protected]> Signed-off-by: Shintaro Sakoda <[email protected]> Signed-off-by: Shintaro SAKODA <[email protected]> Co-authored-by: anhnv3991 <[email protected]> Co-authored-by: SakodaShintaro <[email protected]> Co-authored-by: Shintaro Sakoda <[email protected]> Co-authored-by: SakodaShintaro <[email protected]> * Coding Signed-off-by: anhnv3991 <[email protected]> * Rearrange the code to avoid duplicated processing Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * Added multithread voxel grid build Signed-off-by: anhnv3991 <[email protected]> * Fixed build error Signed-off-by: anhnv3991 <[email protected]> * Fixed build errors Signed-off-by: anhnv3991 <[email protected]> * Applied clang Signed-off-by: anhnv3991 <[email protected]> * Added line break at the end of .h and .hpp files Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix * Removed unused include and comments Signed-off-by: anhnv3991 <[email protected]> * Removed unused include and fixed a segmentation fault when sync in setThreadNum Signed-off-by: anhnv3991 <[email protected]> * Fix build error when compare int with size_t Signed-off-by: anhnv3991 <[email protected]> * Fix build error when compare int with size_t Signed-off-by: anhnv3991 <[email protected]> * style(pre-commit): autofix --------- Signed-off-by: anhnv3991 <[email protected]> Signed-off-by: Shintaro Sakoda <[email protected]> Signed-off-by: Shintaro SAKODA <[email protected]> Co-authored-by: anhnv3991 <[email protected]> Co-authored-by: SakodaShintaro <[email protected]> Co-authored-by: Shintaro Sakoda <[email protected]> Co-authored-by: SakodaShintaro <[email protected]>
Refactored multigrid_ndt_omp.h and multigrid_ndt_omp_impl.hpp to remove unused variables and functions and prepare for the parallel ndt build (which will be added in the future).