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
Parallel SVM::trainAuto: uses parallel_for_ to dispatch all parameters combination … #9310
Conversation
modules/ml/src/svm.cpp
Outdated
Mat temp_train_responses(train_sample_count, 1, rtype); | ||
Mat temp_test_responses; | ||
|
||
int i,j,k,p; |
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, don't use obsolete C-style loop variables declaration.
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.
Just copy/pasted the original code. I was thinking to follow the coding rules doing like this
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.
If only my 3 loops are using C++ style loop declaration and ALL the rest of SVM code is using C-style, this will look weird
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.
SVM code already contains the both styles, take a look at static bool solve_*
functions.
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.
Corrected.
If it is OK for you, I will merge the 2 commits
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.
It's ok.
modules/ml/src/svm.cpp
Outdated
|
||
vector<int> sidx; | ||
setRangeVector(sidx, sample_count); | ||
|
||
int i, j, k; | ||
int i, k; |
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.
The same thing about loop variables.
👍 |
SVM::trainAuto is just 6 loops. I create a list of tasks and compute them using parallel_for_
This pullrequest changes
Add parallel functionality to SVM::trainAuto