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
Conversation
@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. |
@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) |
Bump |
@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 |
bcf2149
to
5aed754
Compare
065561b
to
5ea011f
Compare
5ea011f
to
f325d8e
Compare
now I apologise for the delay! went overseas, which is the only reason I was 'bump'ing earlier. |
see #5783 |
No description provided.