opencv_contrib
opencv_contrib copied to clipboard
Is there anyway to parallel training random forest.
System information (version)
- OpenCV => 3.1
- Operating System / Platform => mac
- Compiler => clang
Detailed description
Steps to reproduce
Random forest training use single thread, which is not time efficient. Is there anyway to parallel training random forest.
I guess that the for loop right here allows for applying a parallel for. We only need to keep track somehow of which features are already taken by the process in previous trees. This can be done with a global lookup table.
Is there any plan to add this feature?
I couldn't parallelize the tree loop, but I was able to parallelize the inner variable loop using parallel_for_. On the unit tests, it results in ~2x speedup for regression - maybe I'll try to clean things up and create a PR.