Increase training and inference performance for GAK kernel#77
Increase training and inference performance for GAK kernel#77lejafar wants to merge 7 commits intotslearn-team:mainfrom
Conversation
rtavenar
left a comment
There was a problem hiding this comment.
Thanks for your PR, this is a good idea indeed.
rtavenar
left a comment
There was a problem hiding this comment.
Thanks for your PR, this is a good idea indeed.
Could you please answer my 2 questions so that I can make my opinion on these two technical points?
Thanks,
Romain
|
Woops sorry for double posting my review... |
|
@rtavenar anything else? |
|
Hi @lejafar Sorry it took me so long to get back to you. Your suggestion is still welcome but the codebase has changed quite a lot since you posted it. Specifically, we are working on a future release in the dev branch. So, my question is : would you be willing to close this PR and open a new one based on the current dev branch ? The place where your hack could be inserted is probably around: |
Hi! I've been using the
TimeSeriesSVCwith thegakkernel for a while now and I've made some changes that increased the performance quite a bit, the most time consuming part in my case was computing the kernel and its there where I've made some changesChanges that apply to training:
To compute the self-similarity, scikit-learn evaluates the callable kernel using a reference of X as the second argument, in the current implementation will check if the second argument is
Nonewhich it isn't, hence it computes everything twiceChanges that apply to inference:
When doing prediction, scikit-learn evaluates the callable kernel for every point (
X_fit) seen up until then, but the only thing libsvm really needs is the distance to its support vectors, hence we can omit computing the others.