opencv_contrib icon indicating copy to clipboard operation
opencv_contrib copied to clipboard

Is there anyway to parallel training random forest.

Open huangynn opened this issue 7 years ago • 3 comments

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.

huangynn avatar Nov 29 '17 10:11 huangynn

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.

StevenPuttemans avatar Dec 04 '17 12:12 StevenPuttemans

Is there any plan to add this feature?

huangynn avatar Dec 05 '17 06:12 huangynn

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.

danielenricocahall avatar Jun 27 '19 01:06 danielenricocahall