opencv / opencv_contrib

Repository for OpenCV's extra modules
Apache License 2.0
9.36k stars 5.75k forks source link

Is there anyway to parallel training random forest. #3653

Open huangynn opened 6 years ago

huangynn commented 6 years ago
System information (version)
Detailed description
Steps to reproduce

Random forest training use single thread, which is not time efficient. Is there anyway to parallel training random forest.

StevenPuttemans commented 6 years ago

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.

huangynn commented 6 years ago

Is there any plan to add this feature?

danielenricocahall commented 5 years ago

I couldn't parallelize the tree loop, but I was able to parallelize the inner variable loop using parallelfor. On the unit tests, it results in ~2x speedup for regression - maybe I'll try to clean things up and create a PR.