Skip to content
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

Merged
merged 1 commit into from Sep 18, 2017

Conversation

r2d3
Copy link
Contributor

@r2d3 r2d3 commented Aug 4, 2017

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

Mat temp_train_responses(train_sample_count, 1, rtype);
Mat temp_test_responses;

int i,j,k,p;
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok.


vector<int> sidx;
setRangeVector(sidx, sample_count);

int i, j, k;
int i, k;
Copy link
Contributor

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.

@sovrasov
Copy link
Contributor

sovrasov commented Aug 8, 2017

👍

@opencv-pushbot opencv-pushbot merged commit 7c334f4 into opencv:master Sep 18, 2017
opencv-pushbot pushed a commit that referenced this pull request Sep 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants