Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
22 additions
and
59 deletions.
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
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
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
971d67d
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.
Two problems here, which is why I was trying the other things (apart from that it doesnt compile)
When using this from the cpp interface, one gets "wrong" type when doing
svm.put("kernel", kernel("Gaussian"))
This is since "kernel" is registered as
CSGObject
but since theput
here is templated, it is matched againstCKernel*
. So @lisitsyn and I decided to make it not templated but explicit only forCSGObject*
To reproduce, run the meta examples for cpp (kwargs.sg)
The Octave "float as int" problem. One could argue that this can be solved with
%extend
. However, there is the general problem that4.0
might have a different type in the target languages (is it int32 everywhere?). In particular for scalar literals (to set parameters), it might be annoying from an interface perspective if we enforce the word length rather than just accepting anything (maybe warning) and converting.To reproduce, again run kwargs.
971d67d
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 considered fixed in 2f488e4
test both the cpp kwargs (you get a nice deprecation warning) and as well in python interface --- see the travis CI for this branch was failing because:
needs similar hacks in the swig interface definition as dynobjarray.
971d67d
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.
btw: RE 1) @lisitsyn @karlnapf
my deprecation message actually summarizes what i think of this issue. if type-checking is actually done over a registered class then i dont understand why dont we narrow it down to the reasonable level. namely of course it will scream the
has<T>
that the supplied object is not in the right type as you expect CSGObject for akernel
. that parameter shoudl be registered asCKernel
as its declared type in the class not asCSGObject
... that way actually we would do some good for us as now you can actually put a KernelMachine or Distance or whatever SGObject derived stuff to that particular parameterkernel
, nothing will scream at you when you add if you pass it asCSGObject*
.... imo that's actually a bug in the param registration end and just shooting ourselves in the leg, i.e. prone to error later... of course something somewhere will catch it when you actually start training the kernel machine. but wouldn't it be nicer to already catch it at put?actually i think that the hacky-fix of 2f488e4 should move into
has
and not in put. we should just do the upcasting there but for really a limited time until param registration for base classes are supported; likeCKernel
,CFeatures
etc.