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

Fix svm examples (Bug #4096) #3941

Closed
wants to merge 6 commits into from
Closed

Conversation

dhood
Copy link
Contributor

@dhood dhood commented Apr 19, 2015

No description provided.

@vpisarev
Copy link
Contributor

@dhood, thanks for the patch! I'd suggest to use a bit different solution though. The performance increase when using a single compressed support vector is so dramatic that I would always use it. What we can do is to add another field in SVMImpl, "Mat compressed_sv", which is computed and used for prediction when we train/load linear SVM. In other words, optimize_linear can be done not in-place. With your patch, however, user needs to make this principal decision, whether he/she wants a fast prediction or wants to get the real support vectors.

Also, I'm not sure if your patch handles "load svm from file" case correctly. At least, I do not see where useCompressedSV is written or read.

@dhood
Copy link
Contributor Author

dhood commented Apr 21, 2015

@vpisarev, I agree - I originally had implemented it as you propose and added a parameter to getSupportVectors so that the user could get the raw SVs or the compressed one, but when I saw your comment on #3881 I changed approach. I will change it back to as you suggest, and will just simply not pass any option to getSupportVectors.

If your comment does not apply at this point in time, I will add an option to retrieve the compressed vector (or an additional method)

@dhood
Copy link
Contributor Author

dhood commented May 5, 2015

Bump

@vpisarev
Copy link
Contributor

vpisarev commented Jun 1, 2015

@dhood, sorry for delay. As I see, uncompressed_sv's are not stored in XML, which probably means that after save & load the function getSupportVectors(false) will not work as expected

@dhood
Copy link
Contributor Author

dhood commented Oct 11, 2015

now I apologise for the delay! went overseas, which is the only reason I was 'bump'ing earlier.
not sure if you have any suggestions around the ABI compliance error. just wait till the next release? thanks for the advice

@vpisarev vpisarev mentioned this pull request Dec 10, 2015
@vpisarev
Copy link
Contributor

see #5783

@vpisarev vpisarev closed this Dec 10, 2015
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

2 participants