-
Notifications
You must be signed in to change notification settings - Fork 632
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
Discussion on strategies towards multi-threading particle filter algorithms #610
Comments
I think to start with the particle filter algorithms could be a little bit more generalized and the particle filter algorithms need to be separated into their own classes. Here's a start of some of my ideas: |
Great! I'll merge in an experimental branch to continue testing there, ok? Here it is: https://github.com/MRPT/mrpt/tree/dev-PF-refactor |
Ok. I broke the python bindings. I can fix them later if you like those changes. |
No problem for the bindings. I'll take a closer look at the changes (the entire set of classes for PF is really intertwined and a bit intricate, honestly...) and come back. |
Hmm... after a first "in depth" (not enough, tough) look at the changes, I have some comments:
I couldn't build it for testing, so perhaps I'm wrong. Anyhow, allowing such a signature without |
I probably should have called those two separate things The one template version needs to be pushed down into the individual classes and called something else I realized too late that template instantiation is probably overkill for this. I was jumbling things around trying to get things to compile and I went a little crazy.
I think also about a factory pattern to fix this. The two template version seems powerful though. You can use your own version of the algorithm. If you made processActionObservation templated as well you could have as many variations of particle filters as you want and the algorithms would be fairly loosely coupled. Hopefully this can improve reuse.
|
(Follow-up from mrpt-users mailing list here)
Things to bear in mind:
There are 4 different PF algorithms in MRPT. See https://www.mrpt.org/tutorials/programming/statistics-and-bayes-filtering/particle_filter_algorithms/
Read also first: https://www.mrpt.org/tutorials/programming/statistics-and-bayes-filtering/particle_filters/
What parts should be subtle to multi-threading? I think that evaluation of observation likelihood is probably the easiest spot. There are other costly areas in the "optimal sampling" algorithm, but at least when a dynamic number of particles is enabled, we must synchronize among threads.
overall: possible patches should go to "master" (new features will not get into the mrpt-1.5 branch). Also, the feature must be disabled or enabled by the user from an INI file entry.
Depending on whether we are doing SLAM or localization, different parts of the PF algorithms are subject to a gain from parallelization.
From the top of my head, I think that one possible place to implement parallelization is at each specific implementation of these 4 virtual methods of CParticleFilterCapable:
Let's use this thread to further discuss possible strategies on how to address this feature.
The text was updated successfully, but these errors were encountered: