-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 issue #3612 #4127
Merged
vigsterkr
merged 16 commits into
shogun-toolbox:develop
from
dhelekal:feature/customkernel-subset-fix
Jan 29, 2018
Merged
Fix issue #3612 #4127
Changes from 7 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
549e646
First attempt at fixing #3612
574922b
Attempt #1 to fix segfault
9e8e5e2
Revert "Attempt #1 to fix segfault"
214c8e4
segafault fix attempt no2
c801712
Whitespace fix
be69f9a
Formatting fix
70ab831
Added that single space character to make the style checker happy
599d4ed
Added unref for the two subset stacks
02ed8a9
adds unit test functions for combined kernel subsetting behaviour. Fi…
72dfbb9
Formatting
deb551f
More formatting changes
ebea19f
indent fix
cb0aa15
removed a line to make the style checker happy
3205bde
Replaced explicit casts with dynamic casts
d831611
tab fixes
a8a50ad
:(
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think you shouldn’t clear the subsets here.
This should happen from outside (and only the last one) as otherwise you might remove stuff a user has set previously
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.
I operated under the assumption that the subset should be maintained in sync with the combinedfeatures used to init the combinedkernel. Normally, as per my understanding, the subset for the subkernels is obtained from the features used to init them. (The init(features l, features r) method of custom kernel in fact clears the subsets).
As the custom kernel has no features in the 1st place, I attempted to replicate what an init() would do if it had features.
Alternative approach: I could instantiate CIndexFeatures using lhs_subset/rhs_subset, then init the custom kernel using these. This might actually be a better approach, on a second though
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.
Update: There seems to be an inconsistency within
CCustomKernel::init(CFeatures* l, CFeatures* r)
.Namely, if l & r are of type CIndexFeatures the normalizer doesnt get called, see following block
Is this intentional or not?
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.
Most things in there were written in demand if one specific use case, so probably no.
I think everything should be consistent between normal kernels and custom kernels.
So maybe we keep it like this.
Memory check is important before merging though
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.
I'm not 100% certain what do you mean re: consistency; could you please clarify it to me, perhaps on irc?
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.
Sorry. I meant do it the same way for custom kernels as for normal kernels (clearing the stack)
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.
OK, so keep the current method, rather than providing dummy indexfeatures, and calling the customkernels init on those? (+ and fix the memory issues)