--- Log opened Wed Feb 07 00:00:52 2018 | ||
-!- HeikoS [~heiko@host86-129-231-92.range86-129.btcentralplus.com] has quit [Quit: Leaving.] | 00:26 | |
-!- slayerjain [uid117577@gateway/web/irccloud.com/x-hzaguvshltgmtnia] has joined #shogun | 05:50 | |
-!- durovo [~durovo@57.65.2ea9.ip4.static.sl-reverse.com] has quit [Remote host closed the connection] | 07:16 | |
-!- durovo1 [~durovo@57.65.2ea9.ip4.static.sl-reverse.com] has joined #shogun | 07:16 | |
-!- slayerjain [uid117577@gateway/web/irccloud.com/x-hzaguvshltgmtnia] has quit [Quit: Connection closed for inactivity] | 09:39 | |
-!- HeikoS [~heiko@host86-129-231-92.range86-129.btcentralplus.com] has joined #shogun | 09:46 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 09:46 | |
@HeikoS | wiking: whats your take on https://github.com/shogun-toolbox/shogun/pull/4154 | 09:48 |
---|---|---|
@HeikoS | lisitsyn: ^ the thing works for all interfaces now | 09:48 |
@HeikoS | it's a bit of a brute force solution though ... | 09:48 |
lisitsyn | HeikoS: checking | 09:49 |
@wiking | but that huge hack is for which languages? | 09:50 |
@wiking | all/ | 09:50 |
@wiking | ? | 09:50 |
lisitsyn | ok it can be fixed later | 09:50 |
lisitsyn | at least the hack is really isolated | 09:50 |
lisitsyn | I like it | 09:50 |
@HeikoS | its in libshogun | 09:50 |
@HeikoS | the thing is | 09:50 |
@HeikoS | you CAN do float(4.0) in octave | 09:50 |
@wiking | HeikoS, but if this is only for octave | 09:51 |
@wiking | then why dont you just forget kwargs in octave? :) | 09:51 |
@HeikoS | this is not for kwargs in octave | 09:51 |
@HeikoS | it is to have put in octave | 09:51 |
@HeikoS | put("name", value) | 09:51 |
@wiking | " kwargs ~works~ for objects ~already~ #4154 " | 09:51 |
@wiking | :) | 09:51 |
@HeikoS | ah yeah | 09:52 |
@HeikoS | sorry thats obsolete | 09:52 |
@wiking | ok so this whole thing could go | 09:52 |
@wiking | if we would drop support for octave | 09:52 |
@wiking | right? | 09:52 |
@HeikoS | not really | 09:52 |
@HeikoS | it is a more general problem | 09:52 |
@HeikoS | what type has 4.0 in python? | 09:53 |
@wiking | float | 09:53 |
lisitsyn | DEPENDENT TYPES FOR THE WIN LOL | 09:53 |
@HeikoS | and what if you want to use that in a put for a 32/64 bit | 09:53 |
lisitsyn | yeah it is ambiguous in many langs | 09:53 |
@wiking | float = double | 09:53 |
@wiking | there's no double in python | 09:53 |
@wiking | *float that is | 09:53 |
@wiking | 32bit flot | 09:53 |
@wiking | it's always double | 09:54 |
@HeikoS | if you register a 64 variable in tags | 09:54 |
@HeikoS | and then you do put("name", 4.0) in python | 09:54 |
@HeikoS | you might get type error | 09:54 |
@wiking | ? | 09:54 |
@wiking | it's always double in python | 09:54 |
@HeikoS | or vice verse | 09:54 |
@HeikoS | 32 bit tag | 09:55 |
@HeikoS | and you do put with 4.0 | 09:55 |
@wiking | mmm imo then this should be in the swig interface | 09:55 |
@HeikoS | whatever the std type of that literal is | 09:55 |
@wiking | no? | 09:55 |
@wiking | i mean these type of hacks | 09:55 |
@HeikoS | so then what happens is put("name" np.float32(bla)) | 09:55 |
@wiking | which are very much language dependent | 09:55 |
@HeikoS | it comes from tags being strict on types, no hierarchy | 09:55 |
@wiking | should be residing in the swig interface object | 09:55 |
@wiking | no? | 09:55 |
@wiking | *interface library | 09:56 |
@HeikoS | I agree, it should sit there | 09:56 |
@HeikoS | BUT | 09:56 |
@HeikoS | thats even more messy | 09:56 |
@HeikoS | lisitsyn and I discussed | 09:56 |
@HeikoS | at least if it is in libshogun, there is only one place of mess | 09:56 |
@HeikoS | and this put is just for swig really, not intended for internal use | 09:56 |
@wiking | HeikoS, i dont get it why is it more messy? | 09:56 |
@wiking | i understand but what i dont get is why is it being messier | 09:56 |
@wiking | to be in a swig interface | 09:56 |
@wiking | where then you can have full control | 09:56 |
@HeikoS | i think it will be different for every lang, no? | 09:57 |
@wiking | over each and every specific lang | 09:57 |
@wiking | yeah but that's the point no | 09:57 |
@wiking | you want to filter out shit | 09:57 |
@wiking | the earliest possible | 09:57 |
@wiking | in the inputs | 09:57 |
@wiking | 'shits' = caveats of the lang | 09:57 |
@HeikoS | while I agree with that early thing, imo, having this at a single point is a bit easier to controll | 09:57 |
@wiking | ? | 09:58 |
@wiking | we already have typemaps | 09:58 |
@wiking | per language | 09:58 |
@wiking | as it's required right? | 09:58 |
@wiking | we could handle this in the very same way | 09:58 |
@wiking | in a way this is a typemap story as well | 09:58 |
@HeikoS | Touching 8 typemaps yes | 09:58 |
@wiking | but i mean | 09:58 |
@wiking | not the actual typemap | 09:58 |
@wiking | as this is specifically for put/get functionality | 09:59 |
@wiking | hence that could be a new .i | 09:59 |
@wiking | that is required to be specified | 09:59 |
@wiking | for a new lang | 09:59 |
@HeikoS | sure or that | 09:59 |
@wiking | i mean dont get me wrong i know that it prbabily never happen | 09:59 |
@wiking | but what if somebody comes | 09:59 |
@wiking | and wants go | 09:59 |
@wiking | and whatever other lang map | 09:59 |
@wiking | and for sure it has its own | 09:59 |
@wiking | nice super hacks | 09:59 |
@wiking | so then you are expected | 09:59 |
@wiking | to hack this stuff? | 09:59 |
@wiking | i mean kudos to your efforts | 09:59 |
@wiking | but this is messy | 10:00 |
@wiking | as you know it | 10:00 |
@HeikoS | yeah it is | 10:00 |
@HeikoS | I mean | 10:00 |
@wiking | and probably it's only you and lisitsyn who will be able to touch it | 10:00 |
@HeikoS | Nah I mean it is not that bad | 10:00 |
@wiking | if there's anything to be done | 10:00 |
@wiking | it is | 10:00 |
@HeikoS | I could have written these things out, template is just to make it compact | 10:00 |
@wiking | it's a concatenation of defines | 10:00 |
@wiking | only way to nicely figure it out what happens | 10:00 |
@wiking | is to use -E | 10:00 |
@HeikoS | true | 10:00 |
@wiking | if you are not hacking shogun for the last 2 years | 10:00 |
@HeikoS | could be copy pasted as well :D | 10:00 |
@HeikoS | yeah I agree | 10:01 |
@wiking | so i nmean | 10:01 |
@wiking | if you have it divided into smaller | 10:01 |
@wiking | language specific chunks | 10:01 |
@wiking | people might have a better grip on it | 10:01 |
@wiking | but i men | 10:01 |
@wiking | *i mean | 10:01 |
@wiking | these are imo | 10:01 |
@HeikoS | yeah sure | 10:01 |
@wiking | but i feel that because of octave | 10:01 |
@HeikoS | it's good that you raise these points | 10:01 |
@wiking | and other shits | 10:01 |
@wiking | you are making the underlying lib a bit messier | 10:02 |
@wiking | than it already is | 10:02 |
@wiking | which was *always* the case | 10:02 |
@wiking | dont get me wrong | 10:02 |
@wiking | it's not your fault | 10:02 |
@wiking | this was always true | 10:02 |
@wiking | but i was hoping we can lower the entropy | 10:02 |
@wiking | :) | 10:02 |
@HeikoS | yeah sure | 10:02 |
@wiking | with these additional hacks | 10:02 |
@wiking | but hey | 10:02 |
@wiking | merge it | 10:03 |
lisitsyn | uhmm these hacks should actually go into any | 10:03 |
lisitsyn | and that would left is just a set of put/get methods | 10:03 |
@wiking | and see how complicated is to do this | 10:03 |
lisitsyn | which is fine | 10:03 |
@wiking | in octave's interface | 10:03 |
lisitsyn | wiking: are you talking about try types 1) 2) 3) ? | 10:03 |
@wiking | imo that's a good ground to test these ideas | 10:03 |
lisitsyn | try float try double? that? | 10:03 |
@HeikoS | lisitsyn: really, you think that should be in any? | 10:03 |
lisitsyn | yes I think it is fine to have it here | 10:03 |
@wiking | lisitsyn, well better idea ? :) | 10:03 |
lisitsyn | if you can cast | 10:04 |
@wiking | i mean it's tryParse all the time | 10:04 |
lisitsyn | wiking: I just want to clarify what exactly is the hack you don't like | 10:04 |
@wiking | right? | 10:04 |
@wiking | lisitsyn, that it resides here | 10:04 |
@wiking | not in the interface | 10:04 |
lisitsyn | if you're talking about tryFloat tryDouble then I think we can get rid of it | 10:04 |
@HeikoS | lisitsyn: if this is going to be moved to any, then all the #define stuff can go | 10:04 |
lisitsyn | just a little bit later | 10:04 |
@HeikoS | if any would be clever enough to convert things to the appropriate type | 10:04 |
lisitsyn | but definining all the put/get in the sgobject explicitly is good, right? | 10:05 |
@wiking | lisitsyn hacko. :) | 10:05 |
lisitsyn | I mean the patch is mostly about explicitly defining all the get/put | 10:05 |
@wiking | yes i get that part | 10:05 |
lisitsyn | the hack is just to make it work | 10:05 |
@wiking | i understand | 10:05 |
@wiking | what it is about | 10:05 |
@wiking | :) | 10:05 |
lisitsyn | and the hack would go somewhere else | 10:05 |
@wiking | i'm jsut wondering whether or not | 10:05 |
lisitsyn | sooo don't worry be happy | 10:05 |
lisitsyn | :) | 10:05 |
@wiking | we could actually put this into some other place | 10:05 |
lisitsyn | yes | 10:06 |
lisitsyn | I believe into any | 10:06 |
lisitsyn | :) | 10:06 |
@wiking | which is not | 10:06 |
@wiking | in libshogun | 10:06 |
@wiking | :) | 10:06 |
@wiking | i mean we can use helper functions | 10:06 |
lisitsyn | HeikoS: it is just to make any work like variable | 10:06 |
@wiking | think of sg_print story hack | 10:06 |
@wiking | :))) | 10:06 |
lisitsyn | I mean you can do float x=3; double y=5.0; x=y; | 10:06 |
@wiking | in all the interfaces | 10:06 |
lisitsyn | HeikoS: ^ that's the same for any | 10:06 |
@wiking | std::varianteeeee el patron? | 10:06 |
lisitsyn | allowing assigning convertible types is fine I believe | 10:07 |
@wiking | btw wouldn't that actually be more suitable here? | 10:07 |
@wiking | lisitsyn, ^ | 10:07 |
@HeikoS | lisitsyn: ok | 10:07 |
@HeikoS | lisitsyn: I mean by all means do it then | 10:07 |
@HeikoS | lisitsyn: and then we just expose the explicit put methods purely, without try-error types | 10:07 |
@wiking | HeikoS, you can get back to me about this shit | 10:07 |
@HeikoS | and then it's much cleaner? | 10:08 |
@HeikoS | wiking: sorry what? | 10:08 |
@wiking | just a sec | 10:08 |
@wiking | lisitsyn, ok so i might be stupid | 10:09 |
@wiking | but really | 10:09 |
@wiking | why dont we use std::variant? | 10:09 |
lisitsyn | uhm | 10:09 |
lisitsyn | instead of any? | 10:09 |
lisitsyn | I think we would go beyond # of template args | 10:10 |
lisitsyn | :) | 10:10 |
@wiking | :) | 10:10 |
@wiking | but i mean somewher ein the interface | 10:10 |
@wiking | because that's kind of what you want in a way no? | 10:10 |
@wiking | i mean in between swig | 10:10 |
@wiking | and libshogun | 10:10 |
lisitsyn | we start using any as variant | 10:10 |
lisitsyn | that's true | 10:10 |
lisitsyn | but too many possible types | 10:10 |
@wiking | i mean what i dont get honestly now is | 10:11 |
@wiking | why we *only* use .i in our swig | 10:11 |
@wiking | i mean as if we couldn't offload there some c++ functionality | 10:11 |
@wiking | that actually just does some magic wrapping | 10:11 |
@wiking | 'magic' | 10:11 |
lisitsyn | I do not know such a magic | 10:11 |
@wiking | simplifies things for swig | 10:11 |
lisitsyn | if I knew I'd use it :) | 10:12 |
@wiking | see sg_print | 10:12 |
@wiking | idiotism | 10:12 |
lisitsyn | I don't know :) | 10:12 |
@wiking | i mean nothing forces us to only rely | 10:12 |
@wiking | on swig generated stuff | 10:12 |
lisitsyn | in general I agree that offloading to cpp library is good | 10:13 |
@sukey | [https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/45534645e67370b99b1b03667e3e617b6764a175 by vigsterkr | 10:13 |
@wiking | HeikoS, ^ | 10:13 |
lisitsyn | but I don't know what exactly to use | 10:13 |
@HeikoS | wiking: nice will read soon! | 10:14 |
@HeikoS | lisitsyn: I will put a warning for now | 10:14 |
@wiking | HeikoS, dont say nice till u've seen it | 10:14 |
@HeikoS | Setting LibSVM::C1 of type float64_t from float32_t. | 10:14 |
@HeikoS | wiking: :D | 10:14 |
@HeikoS | hey I have a q about typemaps | 10:14 |
@HeikoS | I was trying to extend the put to vector | 10:14 |
@HeikoS | but the typemaps don't want to match | 10:14 |
@HeikoS | i.e. | 10:14 |
@HeikoS | 417: features.put("feature_matrix", matrix) | 10:14 |
@HeikoS | 417: NotImplementedError: Wrong number or type of arguments for overloaded function 'SGObject_put'. | 10:14 |
@HeikoS | 417: Possible C/C++ prototypes are: | 10:14 |
@HeikoS | 417: shogun::CSGObject::put(std::string const &,int32_t) | 10:14 |
@HeikoS | 417: shogun::CSGObject::put(std::string const &,float32_t) | 10:14 |
@HeikoS | 417: shogun::CSGObject::put(std::string const &,float64_t) | 10:14 |
@HeikoS | 417: shogun::CSGObject::put(std::string const &,SGVector< int32_t >) | 10:14 |
@HeikoS | 417: shogun::CSGObject::put(std::string const &,SGVector< float64_t >) | 10:15 |
@HeikoS | 417: shogun::CSGObject::put(std::string const &,SGMatrix< float64_t >) | 10:15 |
@HeikoS | 417: shogun::CSGObject::put(std::string const &,shogun::CSGObject *) | 10:15 |
@HeikoS | and matrix is of type np.float64 | 10:15 |
@HeikoS | ideas? | 10:15 |
lisitsyn | ah | 10:15 |
@HeikoS | funny thing is that RealFeatures features(matrix) works | 10:15 |
lisitsyn | so it doesn't work for you as well | 10:15 |
lisitsyn | ok | 10:15 |
lisitsyn | :) | 10:15 |
lisitsyn | that's exactly where it stopped working for me | 10:15 |
@HeikoS | hehe | 10:15 |
@HeikoS | I digged a bit and also found that | 10:16 |
lisitsyn | HeikoS: to debug it check the generated swig cpp | 10:16 |
lisitsyn | find implementation of put | 10:16 |
lisitsyn | and you will find that it doesn't generate things for SGMAtrix properly | 10:16 |
@wiking | HeikoS, what do you wanna put? | 10:16 |
lisitsyn | it didn't use the typemap | 10:16 |
@HeikoS | 417: features = RealFeatures("asdas") | 10:16 |
@HeikoS | 417: NotImplementedError: Wrong number or type of arguments for overloaded function 'new_RealFeatures'. | 10:16 |
@HeikoS | 417: Possible C/C++ prototypes are: | 10:16 |
@HeikoS | 417: shogun::CDenseFeatures< float64_t >::CDenseFeatures(int32_t) | 10:16 |
@HeikoS | 417: shogun::CDenseFeatures< float64_t >::CDenseFeatures() | 10:16 |
@HeikoS | 417: shogun::CDenseFeatures< float64_t >::CDenseFeatures(shogun::CDenseFeatures< float64_t > const &) | 10:16 |
@HeikoS | 417: shogun::CDenseFeatures< float64_t >::CDenseFeatures(shogun::SGMatrix< double >) | 10:16 |
@HeikoS | 417: shogun::CDenseFeatures< float64_t >::CDenseFeatures(shogun::CFile * | 10:16 |
@HeikoS | so if you try the wrong input to the ctor | 10:17 |
@HeikoS | it gives you a different signature | 10:17 |
@HeikoS | CDenseFeatures(shogun::SGMatrix< double >) | 10:17 |
@HeikoS | rather than shogun::CSGObject::put(std::string const &,SGMatrix< float64_t >) | 10:17 |
lisitsyn | I don't know if it is due to overloading | 10:17 |
lisitsyn | but it didn't work for me exactly the same way | 10:17 |
lisitsyn | when I was trying to rename them | 10:17 |
@HeikoS | I am puzzled about the double vs float64 | 10:17 |
@wiking | HeikoS, i might be blind can you give me your put line? | 10:18 |
lisitsyn | I don't think it is about float64 | 10:18 |
@wiking | matrix ? | 10:18 |
@wiking | ize what | 10:18 |
@HeikoS | wiking: it is the first line each in the blobs I pasted | 10:18 |
lisitsyn | HeikoS: just check the swig generated cpp | 10:18 |
@HeikoS | ah | 10:18 |
@wiking | matrix = ? | 10:18 |
lisitsyn | it will be wrong | 10:18 |
@HeikoS | np.zeros((1,2), dtype=np.float64) | 10:18 |
@wiking | ok so SGVector actually | 10:19 |
lisitsyn | hello anybody here | 10:19 |
lisitsyn | :) | 10:19 |
lisitsyn | just find the implementation of put in swig generated cpp | 10:19 |
lisitsyn | :) | 10:19 |
@wiking | :) | 10:19 |
@wiking | yeah but | 10:19 |
@wiking | you can filter these | 10:19 |
lisitsyn | I am 99% sure it is wrong | 10:19 |
@wiking | lisitsyn, have u tried what i've told you? | 10:19 |
lisitsyn | because I had the same problem | 10:19 |
@wiking | with the stupid traits? | 10:19 |
lisitsyn | I don't remember | 10:20 |
lisitsyn | I tried something but nothing | 10:20 |
@wiking | i mean that only works of course | 10:20 |
@wiking | if you allow | 10:20 |
@wiking | to have | 10:20 |
@wiking | putX, putY, putZ | 10:20 |
lisitsyn | I believe it has to have something with overloading | 10:20 |
@wiking | as there you can force with typetraits | 10:20 |
@wiking | that the right put is being called | 10:20 |
@HeikoS | lisitsyn: yeah and the first argument being the same or so | 10:20 |
@HeikoS | wiking: sure, I know, the whole point here is to have a single put | 10:20 |
@HeikoS | in the interfaces | 10:20 |
lisitsyn | yeah we need single put | 10:20 |
lisitsyn | and if you check | 10:21 |
lisitsyn | the | 10:21 |
lisitsyn | generated | 10:21 |
lisitsyn | cpp | 10:21 |
lisitsyn | :) | 10:21 |
@HeikoS | lisitsyn: ok on it | 10:21 |
@HeikoS | 1 sec | 10:21 |
@wiking | if u want one put idk | 10:21 |
lisitsyn | HeikoS: just check how it casts SGMatrix | 10:21 |
lisitsyn | it is probably wrong | 10:21 |
@wiking | then it's some shit with the generated cpp | 10:21 |
lisitsyn | which makes me think swig doing wrong job with overloaded methods | 10:21 |
@wiking | the way i figured out was constantly generating cxx | 10:21 |
lisitsyn | it doesn't apply typemaps properly | 10:21 |
@wiking | lisitsyn, mmmm | 10:21 |
@HeikoS | you know how this is named | 10:21 |
@wiking | lisitsyn, caution there | 10:21 |
@HeikoS | the put thing? | 10:21 |
@wiking | lisitsyn, i caught with the one above | 10:22 |
@wiking | couple of bugs in typemaps | 10:22 |
@wiking | actually | 10:22 |
@wiking | :D | 10:22 |
lisitsyn | HeikoS: try something like __put | 10:22 |
lisitsyn | or _put | 10:22 |
@wiking | lisitsyn, namely for R there were problems with the typemaps | 10:22 |
lisitsyn | wiking: yes that's true | 10:22 |
@wiking | so i mean | 10:22 |
lisitsyn | it is either our configuration for typemaps | 10:22 |
lisitsyn | or swig | 10:22 |
@wiking | sometimes swig is doing the job right | 10:22 |
@wiking | and typemaps are shit | 10:22 |
@wiking | i mean | 10:22 |
@wiking | that's always the case | 10:22 |
@wiking | swig just does what you tell it to do | 10:23 |
lisitsyn | it is not about the internals of typemaps | 10:23 |
@wiking | nothing else | 10:23 |
lisitsyn | it is about applying them or not | 10:23 |
lisitsyn | I think it does not apply them in case of overloading the put method | 10:23 |
lisitsyn | sad! | 10:23 |
lisitsyn | :D | 10:23 |
@wiking | lisitsyn, couldnt we just say .put(std::string, std::function<std::variant> f); | 10:25 |
@wiking | :) | 10:25 |
@wiking | and then | 10:25 |
@wiking | in the specific swig interface | 10:25 |
@wiking | you have to define the lambda | 10:25 |
@wiking | :) | 10:25 |
lisitsyn | aaand the hack of the year award | 10:26 |
lisitsyn | goes to | 10:26 |
lisitsyn | :) | 10:26 |
lisitsyn | HeikoS: did you found? | 10:26 |
@wiking | but then you can enforce there whatever you want | 10:26 |
@wiking | no? | 10:26 |
@HeikoS | lisitsyn: yeah it is convoluted | 10:27 |
lisitsyn | HeikoS: no just find the line it tries to cast to sgmatrix | 10:27 |
lisitsyn | wiking: not sure, variant of what? | 10:27 |
lisitsyn | <...>? | 10:27 |
@wiking | int, long, float,double, sgv<sameprimities>, sgm<sameprimitive>, sgobj | 10:28 |
@wiking | :) | 10:28 |
lisitsyn | I am not sure we don't get beyond the reasonable limit | 10:28 |
@HeikoS | lisitsyn: you have mail | 10:30 |
@wiking | lisitsyn, i mean this was my 1 second attempt | 10:31 |
@wiking | to offload this stuff | 10:31 |
@wiking | into a wrapper .cpp | 10:31 |
@HeikoS | lisitsyn: line 25024 | 10:31 |
@HeikoS | it does a reinterpret_cast<SGMatrix<float64_t> * > | 10:32 |
@HeikoS | I think normally it does something "as_NPYMat64" | 10:32 |
lisitsyn | HeikoS: ye | 10:32 |
lisitsyn | HeikoS: so you can see it didn't use the typemap properly :( | 10:33 |
lisitsyn | the same issue | 10:33 |
@HeikoS | lisitsyn: let me flip the argument order | 10:33 |
@HeikoS | that might help, what you reckon? | 10:33 |
lisitsyn | not sure | 10:33 |
lisitsyn | I think it is about typemaps | 10:33 |
lisitsyn | some flags or options of them | 10:33 |
@HeikoS | I thought it was the const & at first | 10:33 |
@HeikoS | but it didnt help changing that | 10:33 |
lisitsyn | nono | 10:34 |
lisitsyn | it is not const :( | 10:34 |
lisitsyn | tried that as wel | 10:34 |
@HeikoS | lisitsyn: check 304168 | 10:34 |
@HeikoS | thats how it is done in the ctor | 10:35 |
lisitsyn | HeikoS: exactly | 10:35 |
lisitsyn | that's the point | 10:35 |
lisitsyn | HeikoS: from what wiking says if you don't overload it works | 10:35 |
lisitsyn | :) | 10:35 |
lisitsyn | HeikoS: we need a toy example to ask swig guys maybe | 10:36 |
@HeikoS | btw it is not just python | 10:36 |
@HeikoS | java as well | 10:36 |
@wiking | HeikoS, it's swig | 10:37 |
@wiking | :) | 10:37 |
@HeikoS | lisitsyn: you ever read this? http://www.swig.org/Doc1.3/Typemaps.html#Typemaps_overloading | 10:38 |
@wiking | HeikoS, https://github.com/shogun-toolbox/shogun/commit/a4c84ee839dce1a25d5de3277ec5e3e818166017 | 10:47 |
@wiking | in R it was a missing pieace | 10:47 |
@wiking | *piece | 10:48 |
@wiking | and actually it shoudl be | 10:48 |
@wiking | is.numeric || is.bool | 10:48 |
@wiking | as we support bool vectors/matricies | 10:48 |
@sukey | [https://github.com/shogun-toolbox/shogun] Issue https://github.com/shogun-toolbox/shogun/issues/4157 opened by bmurauer | 10:48 |
@sukey | [https://github.com/shogun-toolbox/shogun] Issue https://github.com/shogun-toolbox/shogun/issues/4157 | 10:49 |
@sukey | [https://github.com/shogun-toolbox/shogun] Issue https://github.com/shogun-toolbox/shogun/issues/4157 | 10:49 |
@HeikoS | ah cool | 10:51 |
@HeikoS | wiking: when are the R meta examples coming alive? :D | 10:51 |
@wiking | HeikoS, typemapping problems | 10:52 |
@wiking | we still have 4 failing things | 10:52 |
@wiking | and nobody got back to me | 10:52 |
@HeikoS | i see | 10:52 |
@wiking | about what to do | 10:52 |
@wiking | ;) | 10:52 |
@HeikoS | lisitsyn: so changing argument order does not help :( | 10:52 |
@HeikoS | that is swig peeps? | 10:52 |
@wiking | HeikoS, so 2 things | 10:53 |
@HeikoS | lisitsyn: maybe it has to do with the fact that SGMatrix is templated | 10:54 |
@HeikoS | and in the ctor of RealFeatures, the whole class is templated | 10:54 |
@HeikoS | but in put, there is no class template | 10:54 |
@HeikoS | maybe I need to put %template somewhere | 10:54 |
@wiking | HeikoS, https://travis-ci.org/shogun-toolbox/shogun/jobs/330732721#L3984 | 10:55 |
@wiking | HeikoS, RealFeatures is not | 10:55 |
@wiking | typemaped | 10:55 |
@wiking | note | 10:55 |
@wiking | HeikoS, but you dont need to put anything | 10:56 |
@wiking | for SGM | 10:56 |
@HeikoS | yeah | 10:56 |
@HeikoS | true | 10:56 |
@wiking | if you wanna touch that | 10:56 |
@wiking | you need to go into actual typemap.i | 10:56 |
@wiking | but i guess | 10:56 |
@wiking | this arrices | 10:56 |
@HeikoS | swig warns if overloading shadows methods no? | 10:56 |
@HeikoS | Ill watch out for that | 10:56 |
@HeikoS | wiking: i get more and more gsoc related emails | 10:57 |
@wiking | not me :D | 10:57 |
@HeikoS | I have put "do not contact devs directly" first thing on the wiki | 10:57 |
@HeikoS | I mean COME ONE | 10:57 |
@HeikoS | these guys :D | 10:57 |
@HeikoS | entrance task is like step1-step 10 | 10:57 |
@wiking | HeikoS, you use latest develop? | 10:58 |
@HeikoS | and then they ask, what should I do? | 10:58 |
@HeikoS | wiking: of swig? | 10:58 |
@wiking | no | 10:58 |
@wiking | of shogun | 10:58 |
@wiking | or you hav esome local hacks? | 10:58 |
@HeikoS | yes kinda | 10:58 |
@HeikoS | there is some stuff | 10:58 |
@HeikoS | not too much, why? | 10:58 |
@wiking | but not for put("matrix", matrix) | 10:58 |
@HeikoS | ah | 10:59 |
@HeikoS | yeah I have local changes | 10:59 |
@HeikoS | not in develop | 10:59 |
@wiking | but that's not related to the put | 10:59 |
@wiking | in this case | 11:00 |
@wiking | but yeah while it compiles | 11:00 |
@wiking | can u answer me what to do with the metaexamples | 11:00 |
@wiking | for obtainfor | 11:00 |
@wiking | ? | 11:00 |
@HeikoS | lisitsyn, wiking swig doesnt moan about shadowing | 11:00 |
@HeikoS | obtainfor? | 11:01 |
@wiking | HeikoS, so every now and then | 11:01 |
@wiking | when we need some specific typecast in modular | 11:01 |
@wiking | we introduced the obtain_from_* | 11:01 |
@wiking | that's true for Distributions | 11:01 |
@wiking | for Gaussian | 11:01 |
@wiking | for CrossValidationResults | 11:01 |
@wiking | etc | 11:01 |
@HeikoS | obtain_from_generic | 11:01 |
@HeikoS | yes | 11:01 |
@HeikoS | specialise | 11:01 |
@wiking | but this is sporadic | 11:01 |
@HeikoS | base class pointer | 11:01 |
@wiking | meaning it's only there | 11:01 |
@wiking | when one needed such thing | 11:01 |
@HeikoS | that is for interfaces yes | 11:01 |
@HeikoS | should be as | 11:02 |
@HeikoS | asDistribution | 11:02 |
@wiking | that's the question | 11:02 |
@HeikoS | or even worse | 11:02 |
@HeikoS | as("Distribution") | 11:02 |
@wiking | that now i moved everything | 11:02 |
@wiking | 'everything' | 11:02 |
@wiking | .as<> | 11:02 |
@wiking | to SGObj | 11:02 |
@wiking | so now you can have in c++ anywhere as | 11:02 |
@HeikoS | mmmh | 11:02 |
@HeikoS | not sure we want all of that everywhere | 11:02 |
@HeikoS | only where it makes sense | 11:02 |
@HeikoS | like | 11:02 |
@HeikoS | specialise a kernel to subclass | 11:02 |
@HeikoS | but specialise an sgobject to kernel, why would one want that? | 11:03 |
@wiking | yeah i mean | 11:03 |
@wiking | this is accessible | 11:03 |
@wiking | anywhere :) | 11:03 |
@wiking | that doesn't mean that you have to use it | 11:03 |
@wiking | :) | 11:03 |
@HeikoS | sure and you get an error if it cannot be done | 11:03 |
@HeikoS | I think this is ok | 11:03 |
@HeikoS | interfaces are like this | 11:03 |
@wiking | but i mean | 11:03 |
@wiking | wait | 11:03 |
@wiking | :D | 11:03 |
@wiking | we might misunderstand each other | 11:03 |
@HeikoS | we can thin that out maybe | 11:03 |
@HeikoS | ok :) | 11:03 |
@wiking | so atm .as<> is templated | 11:04 |
@wiking | so if you have | 11:04 |
@wiking | CGaussian | 11:04 |
@wiking | and you call | 11:04 |
@wiking | .as | 11:04 |
@wiking | that still means only | 11:04 |
@wiking | i mean you still need to give | 11:04 |
@wiking | a param | 11:04 |
@wiking | CGaussian.as<Type>() | 11:04 |
@wiking | so it's not that .as is reflected on the class | 11:04 |
@wiking | on which you call it | 11:04 |
@HeikoS | yes, like best_kernel.asGaussianKernel() | 11:05 |
@HeikoS | which might or might not work | 11:05 |
@wiking | well | 11:05 |
@wiking | now this is the thing | 11:05 |
@HeikoS | actually wait | 11:05 |
@wiking | if we want to has as[WhateverType] | 11:05 |
@wiking | we need to spellit out | 11:05 |
@HeikoS | so the thing is | 11:05 |
@wiking | for swig | 11:06 |
-!- travis-ci [~travis-ci@ec2-54-145-239-245.compute-1.amazonaws.com] has joined #shogun | 11:06 | |
travis-ci | it's Viktor Gal's turn to pay the next round of drinks for the massacre he caused in shogun-toolbox/shogun: https://travis-ci.org/shogun-toolbox/shogun/builds/338397063 | 11:06 |
-!- travis-ci [~travis-ci@ec2-54-145-239-245.compute-1.amazonaws.com] has left #shogun [] | 11:06 | |
@HeikoS | as or obtain_from_generic will not be needed anymore in the future | 11:06 |
@HeikoS | since we use tags | 11:06 |
@HeikoS | no need to specialise | 11:06 |
@HeikoS | this is c++ only | 11:06 |
@wiking | what do you do with CrossValResult? | 11:06 |
@HeikoS | best_kernel.get("gaussian_parameter") | 11:06 |
@HeikoS | you get the kernel interface | 11:06 |
@HeikoS | but you don't need the methods specific to gaussian kernel | 11:06 |
@HeikoS | you use tags and the generic kernel interface covers all he rest | 11:07 |
@HeikoS | the rest | 11:07 |
@wiking | lemme copypaste | 11:07 |
@wiking | so we are on the same page | 11:07 |
@HeikoS | ok | 11:07 |
@wiking | result = cross_validation.evaluate() | 11:08 |
@wiking | result = CrossValidationResult.obtain_from_generic(result) | 11:08 |
@wiking | print('kNN mean accuracy in a total of %d runs is %.4f.' % (num_runs, result.get_mean())) | 11:08 |
@wiking | http://shogun.ml/notebook/latest/LMNN.html | 11:08 |
@wiking | y_pred = FactorGraphObservation.obtain_from_generic(labels_test_pr.get_label(i)).get_data() | 11:09 |
@wiking | http://shogun.ml/notebook/latest/Binary_Denoising.html | 11:09 |
@HeikoS | result.get("mean") | 11:09 |
@HeikoS | labels_test.get("labels")[i] | 11:09 |
@HeikoS | in these lines | 11:09 |
@wiking | http://shogun.ml/examples/latest/examples/converter/ica_fast.html | 11:09 |
@HeikoS | lisitsyn: ^ | 11:10 |
@HeikoS | there is probably catches | 11:11 |
@wiking | converted.get("matrix") | 11:11 |
@wiking | ? | 11:11 |
@HeikoS | but I think it should already be possible to replace a few of those things with tag based | 11:11 |
@HeikoS | yeah | 11:11 |
@wiking | ok so then no need to expose this into swig | 11:12 |
@wiking | i mean i thought to expose it | 11:12 |
@wiking | for 'base' classes | 11:12 |
@HeikoS | I think there will be some of those "as" things, as we discussed on hackathon, see the notes in the wiki | 11:13 |
@HeikoS | but definitely not for all classes | 11:13 |
@HeikoS | but in fact, I don't see the need for converting SGObject to Kernel, or similar | 11:13 |
@HeikoS | so I think for now, no need to do that in swig | 11:13 |
@wiking | ok what do we do | 11:14 |
@HeikoS | but there is some work needed to replace all the obtain_from-generic with get | 11:14 |
@wiking | with the examples? :) | 11:14 |
@HeikoS | the notebooks you mean? | 11:14 |
@wiking | yes | 11:14 |
@wiking | i mean everything | 11:14 |
@HeikoS | entrance task | 11:14 |
@HeikoS | "get rid of obtain_from_generic" everywhere | 11:14 |
@HeikoS | and have an example (the x-validation thing is good imo) | 11:14 |
@HeikoS | tags are there, so that can be done now more or less | 11:15 |
@HeikoS | I think this is a good entrance task in fact, especially if there is an example. Shows many things about shogun internals for students | 11:15 |
@wiking | ok so i'll then just mark all the obtain_from deprecated | 11:15 |
@wiking | and then i'll merge this | 11:15 |
@wiking | HeikoS, any objections about the error msg? | 11:16 |
@HeikoS | can you share the link again? | 11:16 |
@wiking | lol | 11:16 |
@HeikoS | sry too many things going on :D | 11:16 |
@wiking | https://github.com/shogun-toolbox/shogun/commit/45534645e67370b99b1b03667e3e617b6764a175 | 11:16 |
@HeikoS | commented | 11:18 |
@wiking | k i will introduce back those obtain froms | 11:19 |
@wiking | so that the examples dont break | 11:19 |
@HeikoS | +1 | 11:20 |
@sukey | [https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/2fb90abee41e29c6d01892f3df09a7c241ba88b8 by vigsterkr | 11:33 |
@HeikoS | lisitsyn, wiking https://github.com/swig/swig/issues/1193 | 11:35 |
@HeikoS | let me know whether this makes sense as a description | 11:35 |
lisitsyn | HeikoS: yeah lets see | 11:37 |
@HeikoS | not too minimal? | 11:37 |
@HeikoS | lisitsyn: I am now actually trying a dummy method CSGObject::test(SGMatrix<double> m) to see what happens there | 11:37 |
lisitsyn | HeikoS: you might come up with non-shogun example | 11:38 |
lisitsyn | which is object + two functions + dummy sgmatrix that compiles via swig | 11:38 |
@HeikoS | lisitsyn: did you try hiding the other put? | 11:38 |
@HeikoS | from swig? | 11:38 |
lisitsyn | no | 11:38 |
lisitsyn | HeikoS: good idea | 11:38 |
lisitsyn | if you hide others and it works | 11:38 |
lisitsyn | then it is obviously some option or bug in swig | 11:38 |
@HeikoS | cool | 11:40 |
@HeikoS | updated | 11:41 |
@HeikoS | the issue | 11:41 |
@HeikoS | ok trying will let you know how that goes | 11:42 |
@wiking | HeikoS, which class you .put? | 11:43 |
@wiking | but yeah nevermind | 11:43 |
@wiking | managed to get it break locally | 11:44 |
@wiking | oik i gotta go | 11:45 |
@wiking | HeikoS, is the feature branch that you wanna merge with th epr | 11:45 |
@wiking | has the all the stuff for reproducability? | 11:45 |
@wiking | i.e. | 11:45 |
@wiking | Possible C/C++ prototypes are: | 11:46 |
@wiking | shogun::CSGObject::put< std::string >(Tag< std::string > const &,std::string const &) | 11:46 |
@wiking | shogun::CSGObject::put< std::string,void >(std::string const &,std::string const &) | 11:46 |
@wiking | shogun::CSGObject::put< float64_t >(Tag< double > const &,double const &) | 11:46 |
@wiking | shogun::CSGObject::put< float64_t,void >(std::string const &,double const &) | 11:46 |
@wiking | shogun::CSGObject::put< int64_t >(Tag< long > const &,long const &) | 11:46 |
@wiking | shogun::CSGObject::put< int64_t,void >(std::string const &,long const &) | 11:46 |
@wiking | shogun::CSGObject::put< CSGObject * >(Tag< shogun::CSGObject * > const &,shogun::CSGObject *const &) | 11:46 |
@wiking | shogun::CSGObject::put< CSGObject *,void >(std::string const &,shogun::CSGObject *const &) | 11:46 |
@wiking | so i dont have the proto for SGM | 11:46 |
@wiking | as you see | 11:46 |
@wiking | this is develop | 11:46 |
@HeikoS | no | 11:56 |
@HeikoS | give me a few hrs and Ill merge with the rest I need | 11:57 |
@HeikoS | lisitsyn: didnt help | 12:04 |
@HeikoS | lisitsyn: aha | 12:05 |
@HeikoS | more information | 12:05 |
@HeikoS | void test(SGMatrix<float64_t> m); | 12:05 |
@HeikoS | features.test(matrix) | 12:05 |
@HeikoS | doesnt work | 12:05 |
@HeikoS | same thing: reinterpret_cast rather than typemap usage | 12:07 |
@HeikoS | there is no overloadig | 12:07 |
@HeikoS | could it be that SGMatrix is forward declared is causing this? | 12:08 |
lisitsyn | HeikoS: did hiding fix that? | 12:28 |
@HeikoS | lisitsyn: nope | 12:28 |
lisitsyn | uhm | 12:28 |
@HeikoS | lisitsyn: but in fact I think the problem is sitting somewhere else | 12:28 |
@HeikoS | lisitsyn: I defined a new method | 12:28 |
@HeikoS | void test(SGMatrix<float64_t> m); | 12:28 |
@HeikoS | and that also doesnt work | 12:28 |
@HeikoS | I just checked, I actually don't understand where SGMatrix is defined in SGObject.h | 12:29 |
@HeikoS | just tried forward declaring it, but no help | 12:29 |
@HeikoS | now trying to include the header | 12:29 |
@HeikoS | lisitsyn: any ideas? | 12:29 |
lisitsyn | HeikoS: AH! | 12:29 |
lisitsyn | forward declaring? | 12:29 |
lisitsyn | how? | 12:29 |
@HeikoS | I actually dont even understand how it compiled | 12:30 |
@HeikoS | as SGMatrix is not defined | 12:30 |
lisitsyn | I mean | 12:30 |
lisitsyn | yeah | 12:30 |
@wiking | HeikoS, what i mean is that if you could just give me anything | 12:30 |
lisitsyn | :) | 12:30 |
@wiking | i could help out | 12:30 |
lisitsyn | template | 12:30 |
@HeikoS | wiking: you can merge the PR actually | 12:30 |
lisitsyn | not sure template forward declaration | 12:30 |
@HeikoS | tests passed | 12:30 |
lisitsyn | works this way | 12:30 |
@HeikoS | shall I? | 12:30 |
@HeikoS | lisitsyn: any idea why it compiles? :D | 12:30 |
@wiking | https://travis-ci.org/shogun-toolbox/shogun/jobs/338429405#L1789 | 12:30 |
lisitsyn | HeikoS: what about trying to include sgmatrix instead of fwd? | 12:31 |
@HeikoS | I can try explicitly defining SGMatrix<float64_t> | 12:31 |
@wiking | argh for swig | 12:31 |
@HeikoS | just doing that | 12:31 |
@wiking | HeikoS, so then your branch is having all the stuff | 12:31 |
@wiking | because i can cherry that | 12:31 |
@wiking | into my local one | 12:31 |
@HeikoS | merge it | 12:31 |
@HeikoS | it is ok | 12:31 |
@HeikoS | it is clean | 12:31 |
@wiking | lisitsyn, ideas how to do [[deprecated]] ? | 12:31 |
@HeikoS | the stuff I am doing now is on top | 12:31 |
shogitter | (ansh103) Wiking. If I want to solve some issues then that would require me building from source, right? You said yesterday that I don't need to do that. Any specifics? | 12:32 |
@wiking | #ifndef SWIG_*** | 12:32 |
@wiking | is argh | 12:32 |
lisitsyn | wiking: deprecate what? | 12:32 |
lisitsyn | :) | 12:32 |
@HeikoS | lisitsyn: but including SGmatrix.h in SGObject is that really a good idea? | 12:32 |
@wiking | lisitsyn, wanna deprecate obtain_from | 12:32 |
lisitsyn | HeikoS: you have to I think | 12:32 |
lisitsyn | either in .h or .cpp | 12:32 |
@HeikoS | lisitsyn: in cpp it is | 12:32 |
@wiking | ansh103 if you want to solve entrance task, then probably you'll have to compile from source... but there are cases that it does not require you to compile from src | 12:32 |
lisitsyn | HeikoS: lets just see if it fixes swig and then decide | 12:33 |
lisitsyn | :) | 12:33 |
@HeikoS | lisitsyn: ok | 12:33 |
@HeikoS | will try the explicit forward declaration after | 12:33 |
@wiking | HeikoS, "I think I prefer static. Putting CSGobjects on stack always caused problems when I tried it | 12:33 |
@wiking | "? | 12:33 |
@HeikoS | wiking: vague memories of problems arising from that | 12:33 |
@HeikoS | but hey | 12:33 |
@HeikoS | I probably shouldnt have written that :D | 12:33 |
@HeikoS | static is cleaner imo as no object is created | 12:34 |
@HeikoS | and the name really belongs to class, not instance | 12:34 |
@wiking | i dont understand | 12:34 |
@wiking | ? | 12:34 |
@wiking | what | 12:34 |
@wiking | i mean the problem is if i click on the github | 12:34 |
shogitter | (ansh103) Okay wiking. Thanks. | 12:34 |
@wiking | then i dont see things anymore | 12:34 |
@wiking | as it has been force pushed | 12:34 |
@wiking | HeikoS, aaah now i see | 12:35 |
@wiking | that thing is gone :) | 12:35 |
@wiking | so it's obsolete | 12:35 |
@HeikoS | ok :) | 12:36 |
@HeikoS | lisitsyn: I am sure it has to do with the fact that SGMatrix is templated | 12:38 |
@HeikoS | but I fix the template argument here | 12:38 |
lisitsyn | HeikoS: probablemente | 12:39 |
@HeikoS | lisitsyn: what about templating the SGMatrix parameter? | 12:39 |
lisitsyn | HeikoS: templating what? | 12:39 |
lisitsyn | how? | 12:39 |
@HeikoS | I mean | 12:39 |
@HeikoS | template the method | 12:39 |
@HeikoS | but put the T into the SGmatrix | 12:39 |
@HeikoS | not as the argument itself | 12:40 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4158 opened by sorig | 12:40 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 merged by karlnapf | 12:41 |
@sukey | [https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/df639840dea92e23d5fb1c1e28591916fb11abef by karlnapf | 12:41 |
@wiking | btw i wonder why this never been used attribute | 12:41 |
@wiking | https://github.com/swig/swig/blob/master/Lib/typemaps/attribute.swg | 12:41 |
@wiking | and wonder why this isn't at all documented | 12:43 |
@HeikoS | hahaha | 12:44 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4158 synchronized by sorig | 12:44 |
@wiking | but i mean it's a good feature | 12:45 |
@HeikoS | lisitsyn: next try: | 12:46 |
@HeikoS | template<class T> | 12:46 |
@HeikoS | void CSGObject::test(SGMatrix<T> m) | 12:46 |
lisitsyn | uhmm how | 12:47 |
@HeikoS | lisitsyn: !!! | 12:47 |
lisitsyn | does that help | 12:47 |
lisitsyn | que paso | 12:47 |
@HeikoS | the typemap is called like this: | 12:47 |
@HeikoS | matrix_from_numpy<float64_t> | 12:47 |
lisitsyn | if you do what? | 12:47 |
@HeikoS | like in the ctor | 12:47 |
@HeikoS | so maybe swig only matches templated SGMatrix | 12:48 |
lisitsyn | ah | 12:48 |
lisitsyn | ahh | 12:48 |
lisitsyn | uh | 12:48 |
@wiking | swig can only match instantiated templates | 12:48 |
@wiking | HeikoS, do you list all the SGM<T>s | 12:48 |
@wiking | in your .i? | 12:49 |
@HeikoS | does it need to be listed in the .i | 12:49 |
@HeikoS | ah getting closer | 12:49 |
@HeikoS | wiking: so I actually want everything to be explicit for now | 12:49 |
@wiking | you need to declare it | 12:49 |
@HeikoS | aha | 12:49 |
@wiking | if you dont | 12:49 |
@HeikoS | lemme check | 12:49 |
@wiking | it as if it doesn't exist | 12:49 |
@wiking | for swig | 12:49 |
@wiking | i mean see for typemap itself | 12:50 |
@wiking | there's a macro | 12:50 |
@wiking | for both sgv/m | 12:50 |
@wiking | and then they are all called | 12:50 |
@wiking | TYPEMAP_IN_SGMATRIX(uint8_t, NPY_UINT8) | 12:50 |
@wiking | etc | 12:50 |
@HeikoS | sure | 12:51 |
@HeikoS | but I mean | 12:51 |
@wiking | you do the smae for the put? | 12:51 |
@HeikoS | why doesnt it match if I have an explicit thing in an argument | 12:51 |
-!- travis-ci [~travis-ci@ec2-54-204-229-205.compute-1.amazonaws.com] has joined #shogun | 12:51 | |
travis-ci | it's Viktor Gal's turn to pay the next round of drinks for the massacre he caused in shogun-toolbox/shogun: https://travis-ci.org/shogun-toolbox/shogun/builds/338429395 | 12:51 |
-!- travis-ci [~travis-ci@ec2-54-204-229-205.compute-1.amazonaws.com] has left #shogun [] | 12:51 | |
@wiking | do you have | 12:51 |
@HeikoS | which file? | 12:51 |
@wiking | ,put(stdstring, SGMatrix<float64_t>) ... | 12:51 |
@wiking | etc | 12:51 |
@wiking | in SGBase.i | 12:51 |
@wiking | i guess | 12:52 |
@wiking | but i'm just pulling | 12:52 |
@HeikoS | nope I dont | 12:52 |
@HeikoS | thats probably it | 12:52 |
@wiking | oh | 12:53 |
@wiking | so you removed | 12:53 |
@wiking | because that used to be in SGBase.i | 12:53 |
@HeikoS | like this | 12:53 |
@HeikoS | %template(append_element_float) CDynamicObjectArray::append_element<float32_t, float32_t>; | 12:53 |
@wiking | you need to do a sort of -SUPPORT_TAG(String, string, std::string) | 12:53 |
@wiking | i mean | 12:53 |
@wiking | template can have the very same argu | 12:53 |
@wiking | liek | 12:53 |
@wiking | %template(put) ... | 12:53 |
@wiking | but you need to spell it out | 12:53 |
@wiking | all the types | 12:53 |
@wiking | you ever want to support | 12:54 |
@HeikoS | even if the method is not templated? | 12:54 |
@wiking | but the argument is no? | 12:54 |
@HeikoS | void test(SGMatrix<float64_t> m) | 12:54 |
@wiking | i mean it's as if | 12:54 |
@wiking | you ghave | 12:54 |
@wiking | test(std::vector<float> m) | 12:54 |
@wiking | right? | 12:54 |
@HeikoS | sure | 12:55 |
@wiking | HeikoS, https://github.com/swig/swig/issues/652 | 12:55 |
@wiking | btw | 12:55 |
@wiking | it's not very much the same | 12:55 |
@wiking | but pretty similar | 12:55 |
@wiking | until yo udont have | 12:55 |
@wiking | %template(StdVectorA) std::vector<A>; | 12:55 |
@wiking | it's as if it doesn't exist for swig | 12:55 |
@wiking | std::vector<A> | 12:55 |
@HeikoS | I see | 12:56 |
@HeikoS | cool let me try | 12:56 |
@wiking | see the reason | 12:58 |
@wiking | why we have | 12:58 |
@wiking | %template(IntStdVector) vector<int32_t>; | 12:58 |
@wiking | %template(DoubleStdVector) vector<float64_t>; | 12:58 |
@wiking | %template(StringStdVector) vector<string>; | 12:58 |
@wiking | if you dont do that | 12:58 |
@wiking | you cannot hav ethe typemap of swig | 12:58 |
@wiking | for those types | 12:58 |
@HeikoS | so just to be sure | 12:59 |
@HeikoS | this is also true for void test(SGMatrix<float64_t> m) | 12:59 |
@HeikoS | ? | 12:59 |
@HeikoS | no template, all fixed | 13:00 |
@wiking | but you use | 13:01 |
@wiking | a templated class | 13:01 |
@wiking | right? :) | 13:01 |
@wiking | i mean i understand you spell it out there | 13:01 |
@wiking | but still | 13:01 |
@wiking | you use a templated class in the argu | 13:01 |
@wiking | HeikoS, see for example registered_parameters() | 13:01 |
@wiking | it returns an std::vector<std::string> | 13:02 |
@HeikoS | no | 13:02 |
@wiking | if %template(StringStdVector) vector<string>; | 13:02 |
@wiking | would be missing | 13:02 |
@HeikoS | CSGObject::put(SGMatrix<float64_t>) | 13:02 |
@wiking | that thing wouldnt work | 13:02 |
@HeikoS | ah you mean SGMatrix is templated | 13:02 |
@wiking | yes | 13:02 |
@HeikoS | kk | 13:02 |
@wiking | i mean SGMatrix is a template | 13:02 |
@wiking | that needs to be spelled out for swig | 13:02 |
@HeikoS | %template(put) CSGobject::put<std::string, float64_t>; | 13:03 |
@HeikoS | like this I guess? | 13:03 |
@HeikoS | ah no | 13:03 |
@HeikoS | yeah how does the line look? | 13:03 |
@wiking | HeikoS, http://www.swig.org/Doc3.0/SWIGPlus.html#SWIGPlus_nn30 | 13:03 |
@HeikoS | %template(put) CSGobject::put<std::string, SGMatrix<float64_t> >; | 13:03 |
@HeikoS | like that? | 13:03 |
@wiking | check this out | 13:04 |
@wiking | but lemme check what you wrote | 13:04 |
@HeikoS | so it is void SGObject::test(SGMatrix<float64_t> m); | 13:05 |
@wiking | HeikoS, lemme test it for u | 13:07 |
@wiking | finally i have your error | 13:07 |
-!- travis-ci [~travis-ci@ec2-54-204-229-205.compute-1.amazonaws.com] has joined #shogun | 13:14 | |
travis-ci | it's Viktor Gal's turn to pay the next round of drinks for the massacre he caused in shogun-toolbox/shogun: https://travis-ci.org/shogun-toolbox/shogun/builds/338429395 | 13:14 |
-!- travis-ci [~travis-ci@ec2-54-204-229-205.compute-1.amazonaws.com] has left #shogun [] | 13:14 | |
lisitsyn | HeikoS: wiking: did you guys know | 13:22 |
lisitsyn | that new T and new T() are different | 13:22 |
lisitsyn | :D :D | 13:22 |
@wiking | lisitsyn, welcome! | 13:22 |
lisitsyn | trollface | 13:22 |
@wiking | you didn't know | 13:22 |
@wiking | today is a sad day | 13:22 |
@wiking | :( | 13:22 |
@wiking | lisitsyn, didn't know!!! | 13:22 |
lisitsyn | and how do you think they are different? | 13:22 |
@wiking | D: | 13:22 |
lisitsyn | :) | 13:22 |
@wiking | have you seen the on top of that | 13:23 |
@wiking | what they did in c++17? | 13:23 |
@wiking | :D | 13:23 |
@wiking | for new | 13:23 |
lisitsyn | ? | 13:23 |
@wiking | then you'll get argh | 13:23 |
@wiking | :D | 13:23 |
@wiking | hint =align | 13:23 |
lisitsyn | alignas? | 13:23 |
@wiking | yes | 13:23 |
@wiking | HeikoS, so just for the future reference | 13:24 |
@wiking | it helps tremendous | 13:24 |
@wiking | if you add stuff into _wrap_SGObject_put | 13:25 |
@wiking | or gdb it | 13:25 |
@wiking | :) | 13:25 |
@HeikoS | still doenst use the typemap :( | 13:26 |
@HeikoS | reinterpret cast | 13:27 |
@wiking | HeikoS, you wanna look at my tmate? | 13:27 |
@HeikoS | ? | 13:28 |
@wiking | https://tmate.io/ | 13:28 |
@wiking | HeikoS, once ready come here ssh lYlsLYa88vphLIATcUjeLRgIa@fk2.tmate.io | 13:29 |
@wiking | just a sec i have a standup | 13:31 |
@HeikoS | I mean it is not really about realising where the execution goes, it is more that the generated code doesnt call the typemap | 13:31 |
@HeikoS | but I am watching | 13:32 |
@wiking | back | 13:32 |
@wiking | i know | 13:32 |
@wiking | as you can see | 13:33 |
@wiking | it's an ndarray | 13:33 |
@HeikoS | and so? | 13:34 |
@wiking | its not actual array | 13:34 |
@wiking | right? | 13:34 |
@wiking | i mean if then this would map to SGNDarray | 13:34 |
@HeikoS | I think this is more about the generated code | 13:35 |
@HeikoS | and the fact that "from_numpy_*" is not in there | 13:35 |
@HeikoS | rather a cast | 13:35 |
@HeikoS | do we have an untemplated class somewhere that has templated member methods that are used from swig? | 13:35 |
@wiking | mmm where's the macros defined | 13:36 |
@wiking | for numpy | 13:36 |
@wiking | as i think | 13:37 |
@wiking | that thing is going to fail | 13:38 |
@wiking | is_pyvector | 13:38 |
@wiking | wrong | 13:38 |
@HeikoS | again i dont think the problem is at runtime of that generated code but what code is generated | 13:39 |
@HeikoS | check the constructor for RealFeatures e.g. | 13:39 |
@HeikoS | there you see how it should look like | 13:39 |
@wiking | yes | 13:39 |
@wiking | but this how you can figure out | 13:39 |
@wiking | wher eit is generated the wrong way | 13:39 |
@wiking | otherwise its just fishing in the sea | 13:40 |
@wiking | with a needle | 13:40 |
@wiking | i.e. i did the same for | 13:40 |
@wiking | dynobjarray | 13:40 |
@HeikoS | i just checked this actually | 13:40 |
@HeikoS | there you have names like append_float | 13:40 |
@HeikoS | etc | 13:40 |
@HeikoS | ill try that | 13:41 |
@HeikoS | mmh no luck | 13:42 |
@wiking | ok | 13:43 |
@wiking | so there | 13:43 |
@wiking | have u seen it? | 13:43 |
@HeikoS | yes | 13:43 |
@HeikoS | trying to reproduce this | 13:43 |
@wiking | HeikoS, i mean the thing is that tha tis a not typemappable | 13:43 |
@wiking | instance | 13:43 |
@wiking | :) | 13:43 |
@HeikoS | I have changed to template | 13:44 |
@HeikoS | template <class T> | 13:44 |
@HeikoS | void test(SGMatrix<T> m); | 13:44 |
@HeikoS | thats what I am trying right now | 13:44 |
@HeikoS | it still doesnt wanna map the matrix | 13:49 |
@HeikoS | using the above definition | 13:49 |
@HeikoS | and the %template | 13:49 |
@HeikoS | method exists in python, but same error | 13:49 |
@wiking | hahahahah | 13:51 |
@wiking | shouldn't u = sg.RealFeatures(x) work? | 13:51 |
@HeikoS | it does | 13:51 |
@HeikoS | but that class itself is templated | 13:51 |
@HeikoS | what I really dont understand is why it works for dynobjarray | 13:52 |
@HeikoS | and not here | 13:52 |
@wiking | no | 13:52 |
@wiking | so here | 13:52 |
@wiking | if you do | 13:53 |
@wiking | np.array([1,2], dtype...) | 13:53 |
@wiking | that thing of course doesn't work either with RealFeatures | 13:53 |
@wiking | do you have a class that has vectors as input? | 13:53 |
@wiking | i mean csvm? | 13:53 |
@wiking | or which class has a member | 13:53 |
@wiking | of SGVector<float64_t> | 13:53 |
@wiking | ? | 13:53 |
@HeikoS | I do | 13:54 |
@HeikoS | np.zeros( (1,2), dtype=...) | 13:55 |
@HeikoS | and it works with the ctor | 13:55 |
@HeikoS | and the code generated for the ctor is correct | 13:55 |
@HeikoS | calling the typemap | 13:55 |
@wiking | HeikoS, yeah but that's a matrix right? | 13:55 |
@wiking | and you have the explicit | 13:55 |
@wiking | thing for sgMatrix | 13:56 |
@wiking | atm | 13:56 |
@wiking | in your code | 13:56 |
@HeikoS | I tried both explicit | 13:56 |
@wiking | only for SGVect | 13:56 |
@HeikoS | and templated | 13:56 |
@HeikoS | ah | 13:56 |
@HeikoS | see the method i pased above | 13:56 |
@HeikoS | void test(SGMatrix<float64_t> m); | 13:56 |
@HeikoS | or the same thing templated | 13:56 |
@HeikoS | but yes it is matrix | 13:56 |
@HeikoS | the PR that was merged doesnt have matrix | 13:56 |
@wiking | that's why i'm asking for an SGVector | 13:57 |
@wiking | as otherwise it wont work obviously | 13:57 |
@HeikoS | as it was about scalars (the other things are just to make shogun compile due to undefined references in put=) | 13:57 |
@HeikoS | it seems like swig has problems when function arguments are templated | 13:58 |
@HeikoS | rather than templated functions contain parameters of type T | 13:58 |
@HeikoS | i.e. | 13:58 |
@HeikoS | test<T>(T val) | 13:58 |
@HeikoS | vs | 13:58 |
@wiking | why does it blow up | 13:58 |
@HeikoS | test<T>(type<T> val) | 13:58 |
@wiking | if i add SGOBJET_PUT_DEFINE(SGMatrix<float64_T>) | 13:58 |
@wiking | ? | 13:58 |
@HeikoS | dont know | 13:59 |
@wiking | i mean it works for you? | 13:59 |
@wiking | locally? | 13:59 |
@HeikoS | not sure what you mean | 14:00 |
@HeikoS | I just had one more idea | 14:00 |
@wiking | took your line | 14:01 |
@wiking | SGOBJET_PUT_DEFINE | 14:01 |
@wiking | in SGObject.cpp | 14:01 |
@wiking | and did the same | 14:01 |
@wiking | but for SGMatrix<float64_t> | 14:01 |
@wiking | because only sgvector and sgobject is there atm | 14:01 |
@wiking | (develop) | 14:01 |
@wiking | as soon as i did that | 14:01 |
@wiking | the whole thing blew up | 14:01 |
@HeikoS | missing \ | 14:01 |
@HeikoS | ? | 14:01 |
@HeikoS | I have that line and it works | 14:02 |
@HeikoS | ah | 14:02 |
@HeikoS | you need to declare it | 14:02 |
@wiking | df639840dea92e23d5fb1c1e28591916fb11abef | 14:02 |
@wiking | is head | 14:02 |
@HeikoS | these methods are not templated | 14:02 |
@HeikoS | SGOBJECT_PUT_DECLARE(SGMatrix<float64_t>) | 14:02 |
@HeikoS | in header | 14:02 |
@HeikoS | they cannot be templated | 14:03 |
@HeikoS | otherwise CSGObject* complications arise due to template matching :D | 14:03 |
@wiking | who's template matching? | 14:03 |
@wiking | i mean you could just use traits | 14:03 |
@wiking | to not to have that | 14:03 |
@wiking | matching problem | 14:04 |
@wiking | is_base_of<SGObject> | 14:04 |
@wiking | or. not | 14:04 |
@wiking | and then the right template will be matched | 14:04 |
@wiking | see dynobjarray | 14:04 |
@HeikoS | there was another issue | 14:04 |
@HeikoS | has to do with tags | 14:04 |
@HeikoS | and stuff | 14:05 |
@HeikoS | we can make it nicer later | 14:05 |
@HeikoS | first it needs to work | 14:05 |
@HeikoS | for now you need to also declare the thing | 14:05 |
@wiking | declare what? | 14:05 |
@wiking | less cryptic plz | 14:05 |
@HeikoS | check the header | 14:05 |
@wiking | i did | 14:05 |
@HeikoS | if you add your matrix method in the .cpp | 14:05 |
@HeikoS | it also needs to be in header | 14:06 |
@HeikoS | if you did, then i dont understand why it doesnt work, it does for me | 14:06 |
@wiking | ah but ifits in header | 14:06 |
@wiking | as well as in the impl | 14:06 |
@wiking | why don tu just have everything in header? | 14:06 |
@HeikoS | historical reasons | 14:07 |
@wiking | of? | 14:07 |
@wiking | i really dont get it :) | 14:07 |
@wiking | if you need to spell it out in the header | 14:07 |
@wiking | then just spell out everything | 14:07 |
@wiking | especially that it's a 3 liner | 14:08 |
@wiking | right? | 14:08 |
@wiking | i mean the implementation | 14:08 |
@HeikoS | I dont think it matters why that is, but there is a reason that has to do with how this came about. We can easily change it, but it doesnt affect the current problem | 14:09 |
@wiking | i mean im not saying that it effects the current problem | 14:09 |
@wiking | it effects of working with it | 14:09 |
@wiking | i've just tried patching it so that i can get SGMatrix | 14:09 |
@wiking | and as a UX dev experience | 14:09 |
@wiking | this is just not the best | 14:09 |
@wiking | and i wonder why couldn't we move this all into .h | 14:09 |
@wiking | ? | 14:09 |
@wiking | i'm not saying that this is going to solve your problem | 14:10 |
@wiking | but it is actually gonna solve A problem that i was just facing now | 14:10 |
@HeikoS | it can be moved yes | 14:10 |
@HeikoS | unless we template this method at some point | 14:10 |
@HeikoS | then it would be better if it stayed in cpp | 14:10 |
@HeikoS | so for now, i woudnt touch that tbh | 14:11 |
@wiking | :) | 14:12 |
@wiking | this is so funny | 14:12 |
@HeikoS | I woudl reccomend not using the put thing to test SGMatrix | 14:13 |
@HeikoS | too many templated | 14:13 |
@HeikoS | just a simple dummy method is fine | 14:13 |
@HeikoS | I give up now | 14:13 |
@HeikoS | have tried all I could think of | 14:13 |
@HeikoS | couldnt make a simple CSGobject::test(SGMatrix<>) match the typemaps | 14:13 |
@HeikoS | both templated and untemplated | 14:13 |
@HeikoS | no idea | 14:14 |
@HeikoS | it is probably something silly | 14:14 |
@HeikoS | wiking: so you dont need to touch any of that code to reproduce the error | 14:14 |
@HeikoS | just add your ::test(SGMatrix) method | 14:14 |
@HeikoS | one line in header | 14:14 |
@wiking | HeikoS, already did | 14:20 |
@wiking | and that was my conclusion above | 14:21 |
@HeikoS | ? | 14:21 |
@wiking | i.e. i've already added SGMatrix | 14:22 |
@wiking | into develop | 14:22 |
@wiking | now that i know that there are 2 places to be added | 14:22 |
@wiking | and my conclusion about this was written above :) | 14:22 |
@HeikoS | lol I am lost :) | 14:23 |
@HeikoS | but anyways | 14:23 |
@wiking | i'm just debvugging now | 14:23 |
@HeikoS | cool, let me know how it goes | 14:23 |
@HeikoS | I need a break from this thing now | 14:23 |
@HeikoS | will check back later | 14:24 |
@wiking | lisitsyn, putty | 15:06 |
lisitsyn | eh? | 15:07 |
@wiking | lisitsyn, so | 15:07 |
lisitsyn | yas | 15:07 |
@wiking | apparently there's not typemapping kicked in yet in SGBase.i | 15:07 |
@wiking | :D | 15:07 |
@wiking | this is like dynobj array | 15:07 |
@wiking | typemap | 15:07 |
@wiking | typemap | 15:08 |
@wiking | shit | 15:08 |
lisitsyn | I thought about order of stuff | 15:08 |
@wiking | hate vim | 15:08 |
lisitsyn | vim is the best editor | 15:08 |
lisitsyn | :) | 15:08 |
@wiking | %template(putMatrix) shogun::CSGObject::put<SGMatrix<float64_t>, void>; | 15:08 |
@wiking | it's tmux + iterm | 15:08 |
@wiking | and the plugni | 15:08 |
@wiking | made everything clunky to copy | 15:08 |
@wiking | so anyways | 15:08 |
@wiking | see that? | 15:08 |
@wiking | that is exactly what DynObjArray is about right? | 15:08 |
@wiking | so and the generated code is differnet | 15:10 |
@wiking | where in case 1) there's nicely the if(!matrix_from_numpy()) | 15:10 |
@wiking | that you want | 15:10 |
@wiking | case 2) it just does a silly reinterpret casting | 15:11 |
@wiking | lisitsyn, yes | 15:20 |
@wiking | that was it | 15:20 |
@wiking | :)))) | 15:20 |
@wiking | HeikoS, ^ | 15:20 |
@wiking | HeikoS, u can close the github issue for poor swig ppl | 15:22 |
@wiking | HeikoS, https://imgur.com/a/JhMQ4 | 15:27 |
@wiking | lisitsyn, when u have a minture | 15:33 |
@wiking | *minute | 15:33 |
@wiking | ping me because there's a minor issue :)))) | 15:33 |
@wiking | and btw how do you guys wanna solve .get("") | 16:02 |
@wiking | as that cannot be overloaded | 16:02 |
@wiking | return type is not polymorphic | 16:02 |
@wiking | so atm i dont see any other way but getFloat getVector | 16:02 |
@wiking | (with the current interfacE) | 16:03 |
@wiking | HeikoS, so i dropped the macro magic | 16:28 |
@wiking | and used lisitsyn standard put template | 16:28 |
@wiking | there the polymorphism work ... almostish | 16:28 |
@wiking | there's a problem with the constRef | 16:29 |
@wiking | but that could be solved many ways | 16:29 |
lisitsyn | wiking: what helped in the end? | 16:33 |
@wiking | all good | 16:33 |
@wiking | almost | 16:33 |
@wiking | so | 16:33 |
@wiking | you know you do put(..., const T& v) | 16:33 |
@wiking | now there's a bit of shito situation | 16:33 |
@wiking | with constRef | 16:33 |
@wiking | because actually if you think of it | 16:34 |
@wiking | it's typemaped | 16:34 |
@wiking | so that ojjek | 16:34 |
@wiking | *ojjjeeeektuuum | 16:34 |
@wiking | has been just copied/created | 16:34 |
@wiking | in case of SGV/M | 16:34 |
@wiking | anyhow | 16:34 |
@wiking | that thing does not fly | 16:34 |
@wiking | with the current typemaps | 16:34 |
@wiking | if you do put(str, T v) | 16:36 |
@wiking | it's all good | 16:36 |
@wiking | polymorph | 16:36 |
@wiking | microservice | 16:36 |
@wiking | whatever u want | 16:36 |
@wiking | but | 16:36 |
@wiking | now comes the mic-macz | 16:36 |
@wiking | get | 16:36 |
@wiking | :) | 16:36 |
@wiking | what was the vision | 16:36 |
@wiking | we have put(..) | 16:36 |
@wiking | but we have getType() | 16:36 |
@wiking | ? | 16:36 |
@wiking | :) | 16:36 |
@wiking | on the other hand with th eput there could be several ways to solve it | 16:37 |
@wiking | ;P | 16:37 |
@wiking | but anyhow that's what it is | 16:37 |
@wiking | lisitsyn, ah and of course | 16:37 |
@wiking | the other issue of the story is | 16:37 |
@wiking | the place where you placed the %template declarations in SGBase.i | 16:38 |
@wiking | basically the typemaps are not yet kicking in | 16:38 |
lisitsyn | ah ok so it can be solved | 16:38 |
lisitsyn | ok | 16:38 |
lisitsyn | I thought about that | 16:38 |
lisitsyn | but tried so many things | 16:38 |
lisitsyn | and gave up | 16:38 |
@wiking | okok hackmaster | 16:38 |
@wiking | :) | 16:38 |
@wiking | tell me what you want | 16:38 |
@wiking | so i push it then | 16:38 |
@wiking | what do we do with get? | 16:38 |
@wiking | and if we have getTyped | 16:39 |
@wiking | then put ought to be typed | 16:39 |
@wiking | imo | 16:39 |
@wiking | but that's jsut symetricity | 16:39 |
lisitsyn | wiking: no other way but getType | 16:39 |
lisitsyn | :) | 16:40 |
lisitsyn | wiking: I think we might also have get() | 16:40 |
lisitsyn | but that returns some wrapper | 16:40 |
lisitsyn | like here is the parameter | 16:40 |
lisitsyn | you can print it | 16:40 |
@wiking | yeah i mean | 16:40 |
lisitsyn | but if you need the value call the cast | 16:40 |
@wiking | in case we have ONE specific get | 16:40 |
@wiking | then its fine | 16:40 |
@wiking | otherwise you know that its lalala | 16:40 |
lisitsyn | what do you mean? | 16:40 |
@wiking | HackerObject get("") | 16:41 |
@wiking | that works | 16:41 |
@wiking | of course | 16:41 |
@wiking | int get(), float get(), SGVector get() | 16:41 |
@wiking | "nononoooooo you dont love me and i know now" | 16:41 |
@wiking | https://www.youtube.com/watch?v=0mNPKNAQl4c | 16:42 |
@wiking | ?? ????????? ???????? | 16:45 |
@wiking | lisitsyn, what do you wanna do with constnessref? | 16:46 |
lisitsyn | wiking: int get() float get()?? | 16:47 |
lisitsyn | how can that work | 16:47 |
@wiking | lisitsyn, i mean | 16:47 |
@wiking | NONONOO | 16:47 |
@wiking | it does not work | 16:47 |
@wiking | :) | 16:47 |
@wiking | yeye man anyhow u get it | 16:47 |
@wiking | so we need something there | 16:47 |
@wiking | void put(const std::string& name, T const value) throw(ShogunException); | 16:48 |
@wiking | should be | 16:48 |
@wiking | that's the thingy | 16:48 |
@wiking | go nogo? | 16:48 |
lisitsyn | wiking: that's fine | 16:48 |
@wiking | k | 16:48 |
lisitsyn | const T& | 16:48 |
@wiking | yeah i cannot haz | 16:48 |
@wiking | const T^ | 16:48 |
@wiking | & | 16:48 |
lisitsyn | ok then const T | 16:48 |
-!- HeikoS [~heiko@host86-129-231-92.range86-129.btcentralplus.com] has quit [Ping timeout: 248 seconds] | 16:49 | |
lisitsyn | const T const | 16:49 |
lisitsyn | const const | 16:49 |
@wiking | not with SGV/M | 16:49 |
@wiking | COOOOONSSSSST | 16:49 |
@wiking | COOOOONSSSS? | 16:49 |
@wiking | t | 16:49 |
@wiking | anyhow ok | 16:49 |
lisitsyn | con?t | 16:49 |
@wiking | i'll push this you guys look | 16:49 |
@wiking | and decide | 16:49 |
lisitsyn | ok have to go to teach some PYTHONZ | 16:49 |
@wiking | kill it | 16:49 |
@wiking | :> | 16:49 |
lisitsyn | wiking: from sklearn import | 16:50 |
@wiking | :>>>. | 16:50 |
@wiking | mastamustafa! | 16:50 |
@wiking | and you got a stick on your laptop? :D | 16:50 |
@wiking | just to be super ironic | 16:50 |
@wiking | hipster | 16:50 |
lisitsyn | wiking: shogun? yes | 16:50 |
lisitsyn | that's ironic but I can't fraud people | 16:51 |
lisitsyn | :D | 16:51 |
@wiking | :> | 16:51 |
lisitsyn | teaching them shogun to get into ml is like | 16:51 |
lisitsyn | bitcoin? | 16:51 |
@wiking | btw | 16:52 |
@wiking | throw( ) (deprecated in C++11) | 16:52 |
@wiking | throw(typeid, typeid, ...) (deprecated in C++11)(until C++17) | 16:52 |
@wiking | we are aware of this | 16:52 |
@wiking | right/? :)) | 16:52 |
lisitsyn | wiking: I had to put it herer | 16:52 |
lisitsyn | to make swig catch it | 16:52 |
@wiking | swig masta | 16:53 |
@wiking | ! | 16:53 |
lisitsyn | wiking: it does not generate exception catching code by default | 16:53 |
@wiking | lisitsyn, so tell me | 16:53 |
lisitsyn | this fixed the thing but idk | 16:53 |
@wiking | [[deprecated]] | 16:53 |
@wiking | #ifndef SWIG? | 16:53 |
@wiking | or wtf/ | 16:53 |
@wiking | :) | 16:53 |
@wiking | swig doesn't understand attributes | 16:54 |
lisitsyn | dik | 16:54 |
lisitsyn | idk | 16:54 |
lisitsyn | :) | 16:54 |
@wiking | dicky dickson | 16:54 |
@wiking | :) | 16:54 |
@wiking | ok | 16:54 |
@wiking | lemme push the thing | 16:54 |
-!- HeikoS [~heiko@host86-129-231-92.range86-129.btcentralplus.com] has joined #shogun | 17:02 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 17:02 | |
@HeikoS | wiking: jo | 17:03 |
@HeikoS | cool so it works for the put? | 17:03 |
@HeikoS | wiking: could you push the put stuff? | 17:04 |
@HeikoS | amazing! | 17:04 |
@HeikoS | for get, we can have getFloat etc.... | 17:04 |
@HeikoS | push push push :) | 17:08 |
@HeikoS | Im cycling to UCL now, talk later | 17:08 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4158 merged by karlnapf | 17:08 |
@sukey | [https://github.com/shogun-toolbox/shogun] karlnapf pushed 2 commits: | 17:08 |
@sukey | https://github.com/shogun-toolbox/shogun/commit/3e3b166bf6335b265473b9260269709dfaeb870f | 17:08 |
@sukey | https://github.com/shogun-toolbox/shogun/commit/abb0e4a71c5e3e892b3d414a3c1a447dbe663240 | 17:08 |
-!- wikingrr [~Mutter@178.197.228.136] has joined #shogun | 17:11 | |
wikingrr | Sorry | 17:11 |
wikingrr | Had to leave for a meetup.... :))) totally forgot | 17:12 |
-!- wikingrr [~Mutter@178.197.228.136] has quit [Client Quit] | 17:12 | |
-!- HeikoS [~heiko@host86-129-231-92.range86-129.btcentralplus.com] has quit [Ping timeout: 256 seconds] | 17:14 | |
-!- HeikoS [~heiko@untrust-out.swc.ucl.ac.uk] has joined #shogun | 18:12 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 18:12 | |
@sukey | [https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/971d67d946dc67b2fea0f03bd52603f42e4d0a70 by vigsterkr | 18:13 |
@sukey | [https://github.com/shogun-toolbox/shogun] New branch typedo created | 18:13 |
@wiking | HeikoS, ^ | 18:14 |
@HeikoS | wiking: sweet | 18:14 |
@HeikoS | feature branch why? | 18:14 |
@wiking | is it feature? | 18:15 |
@wiking | it's just a branch | 18:15 |
@wiking | i get -ff merge it | 18:15 |
@wiking | just wanted you guys to take a peep b4 adding to develop | 18:16 |
@HeikoS | okok | 18:16 |
@HeikoS | uh | 18:16 |
@HeikoS | mmmh | 18:16 |
@wiking | and this will get me a travis as well | 18:16 |
@HeikoS | I think this will not work with octave | 18:16 |
@wiking | HeikoS, expand :) | 18:16 |
@HeikoS | but will try now | 18:16 |
@HeikoS | yeah will do | 18:16 |
@wiking | python workforme | 18:16 |
@wiking | haven't tested anything else | 18:16 |
@HeikoS | mmmh | 18:17 |
@HeikoS | wiking: you have a min to discuss? | 18:17 |
@wiking | HeikoS, giving a talk | 18:17 |
@wiking | in 2 | 18:17 |
@wiking | :D | 18:17 |
@wiking | but as soon as i'm done | 18:17 |
@HeikoS | ok good luck :) | 18:17 |
@wiking | gonna get back to u | 18:17 |
@wiking | ttyl | 18:17 |
@HeikoS | k | 18:18 |
@HeikoS | lisitsyn: you around? | 18:18 |
@wiking | ok done | 18:44 |
@wiking | HeikoS, sorry it was a hack on the table push | 18:44 |
@wiking | lemmme check | 18:44 |
@HeikoS | nw | 18:44 |
@HeikoS | I am just writing some things under the commit | 18:44 |
@HeikoS | wiking: also make sure to read sergey and mine discussion | 18:44 |
@HeikoS | why we moved away from this kind of approach | 18:44 |
@HeikoS | (but I am writing it down as well) | 18:44 |
@wiking | which kind of approach/ | 18:45 |
@wiking | ? | 18:45 |
@wiking | using template? | 18:45 |
@wiking | i mean mostly that's the diff here | 18:46 |
@HeikoS | the thing in your feature branch | 18:47 |
@wiking | yeah | 18:47 |
@wiking | the diff is | 18:47 |
@wiking | template | 18:47 |
@wiking | (not talking about octave hack) | 18:47 |
@HeikoS | we explicitly made it non template | 18:47 |
@HeikoS | reason I commented in the commit | 18:47 |
@wiking | HeikoS, that could both be solved | 18:48 |
@wiking | by templates | 18:48 |
@wiking | at least 1) for sure | 18:48 |
@HeikoS | octave hack can be done either by %extend, or via libshogun, but that depends on the design q that I also wrote under the commit (and lisitsyn and I decided for the tolerant way) | 18:48 |
@wiking | 2) see the hack | 18:48 |
@wiking | This is since "kernel" is registered as CSGObject but since the put here is templated, it is matched against CKernel*. So @lisitsyn and I decided to make it not templated but explicit only for CSGObject* | 18:49 |
@wiking | this should be fixed with c++11 features | 18:49 |
@wiking | i mean we should do the same fix | 18:49 |
@wiking | in all linalg interfaces btw | 18:49 |
@HeikoS | cool, that would be good | 18:49 |
@wiking | that's why you cant do | 18:50 |
@HeikoS | not saying it can't be solved | 18:50 |
@HeikoS | but that how it currently is doesnt work | 18:50 |
@wiking | linalg::(whateverfunction(), whatverotherfunction()... | 18:50 |
@wiking | just compiling the interfae | 18:50 |
@wiking | the lisitsyn define i added without testing | 18:51 |
@wiking | but i had that spelled out | 18:51 |
@wiking | and worked | 18:51 |
@wiking | so i presume something there with the template i fsck-ed | 18:51 |
@HeikoS | did you try the example? | 18:51 |
@wiking | i've tried your exmple | 18:52 |
@HeikoS | or only put("vector", ...)? | 18:52 |
@wiking | put("vector" | 18:52 |
@wiking | put("matrix") | 18:52 |
@HeikoS | I mean a put("kernel", kernel) | 18:52 |
@HeikoS | from ?pp | 18:52 |
@wiking | swig or cpp? | 18:52 |
@HeikoS | cpp in this case | 18:52 |
@HeikoS | meta cpp | 18:52 |
@wiking | kwargs? | 18:52 |
@HeikoS | y | 18:52 |
@wiking | ok i'll test | 18:52 |
@HeikoS | cool | 18:52 |
@wiking | as soon as i'm ready with the fix | 18:52 |
@wiking | but with cpp it's std::fwd | 18:52 |
@HeikoS | if that is fixed with c++11 template magic that would be neat | 18:52 |
@wiking | i mean it's all about | 18:53 |
@wiking | not having the right type | 18:53 |
@HeikoS | maybe we can put the conversion into any then | 18:53 |
@wiking | when u put a func there | 18:53 |
@wiking | ok | 18:53 |
@HeikoS | that would be cleanest | 18:53 |
@wiking | finally have the error | 18:53 |
@wiking | lemme see why the macro not working | 18:53 |
@HeikoS | but let's make it work first, there is always surprises ;) | 18:53 |
@wiking | nyasgem | 18:55 |
@wiking | it worked :) | 18:55 |
@wiking | i blame everything on lisitsyn's macro | 18:55 |
@HeikoS | lol :D | 18:58 |
@wiking | ah fuck | 19:01 |
@wiking | of course | 19:01 |
@wiking | lol | 19:01 |
@wiking | nobody tells me | 19:01 |
@wiking | typename U = void | 19:01 |
@wiking | :) | 19:01 |
@wiking | HeikoS, ok i forcepysh | 19:02 |
@wiking | testing in the meanwhile | 19:02 |
@wiking | but wanna participate at this thing | 19:02 |
@wiking | if i'm here :) | 19:03 |
@HeikoS | sure | 19:03 |
@HeikoS | I am done for today | 19:03 |
@HeikoS | will read things now | 19:03 |
@HeikoS | but still on hold if you have something | 19:03 |
@sukey | [https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/07b21305711c952e17184581205377bbd583ed72 by vigsterkr | 19:03 |
@wiking | i'll test the cpp | 19:03 |
@wiking | the stuff is now compiling on hedo | 19:03 |
@HeikoS | wiking: https://gist.github.com/karlnapf/066862c86fa0be2a84511a2f81b2964a | 19:04 |
@HeikoS | change it to this | 19:04 |
@HeikoS | the kwargs.sg | 19:04 |
@wiking | kk | 19:04 |
@wiking | will do | 19:04 |
@wiking | ttyl | 19:04 |
@HeikoS | and running in on travis also is good | 19:04 |
@HeikoS | ttly | 19:04 |
-!- travis-ci [~travis-ci@ec2-54-204-229-205.compute-1.amazonaws.com] has joined #shogun | 19:18 | |
travis-ci | it's Viktor Gal's turn to pay the next round of drinks for the massacre he caused in shogun-toolbox/shogun: https://travis-ci.org/shogun-toolbox/shogun/builds/338601139 | 19:18 |
-!- travis-ci [~travis-ci@ec2-54-204-229-205.compute-1.amazonaws.com] has left #shogun [] | 19:18 | |
@wiking | why no k = sg.kernel("GaussianKernel", log_width=2.0) | 19:32 |
@wiking | ? | 19:32 |
@wiking | >>> k = kernel("GaussianKernel") | 19:34 |
@wiking | >>> svm = kernel_machine("LibSVM") | 19:34 |
@wiking | >>> svm.put("kernel", k) | 19:34 |
@wiking | i mean this works, the kwargs does not | 19:35 |
@wiking | but thats because of something else | 19:35 |
@wiking | :) | 19:35 |
@wiking | svm.put("kernel", kernel("GaussianKernel")) | 19:35 |
@wiking | works as well | 19:35 |
@wiking | >>> kernel("GaussianKernel", log_width=2.0) | 19:35 |
@wiking | Traceback (most recent call last): | 19:35 |
@wiking | File "<stdin>", line 1, in <module> | 19:35 |
@wiking | TypeError: kernel() takes no keyword arguments | 19:35 |
@wiking | i mean are we sure tha tthis works? :) | 19:36 |
@wiking | ok anyhow got the problem with cpp | 19:40 |
@wiking | lemme check/test | 19:40 |
@wiking | but i mean man :) SG_ADD((CSGObject**) &kernel, "kernel", "", MS_AVAILABLE); | 19:43 |
@wiking | :>> | 19:43 |
@wiking | and then if you do if(has<T>(_tag.name())) | 19:44 |
@wiking | but ok lemme check | 19:45 |
@wiking | ok ruby and python dies for the same reason: 312 - generated_cpp-meta_api-kwargs (OTHER_FAULT) | 19:46 |
@wiking | so unrelated to swig | 19:46 |
@wiking | ok i can try to do with traits a force upcast, so say if T is is_base_of<SGObject> then do a reinterpret cast for CSGObject* | 19:48 |
@wiking | that should solve this :P | 19:48 |
@wiking | as if i change auto k = kernel("GaussianKernel") | 19:48 |
@wiking | to CSGobject* k = kernel("GaussianKernel"); | 19:48 |
@wiking | the thing works fine | 19:48 |
@wiking | and this is only needed for c++ api | 19:48 |
@wiking | i.e. we can guard it with ifdef | 19:49 |
@HeikoS | the stuff is auto generated | 19:49 |
@HeikoS | so would like to keep auto there | 19:49 |
@HeikoS | and either modify the registration | 19:50 |
@HeikoS | or sort otherwise | 19:50 |
@wiking | yeah i understand the whoel concept | 19:51 |
@wiking | but i mean | 19:51 |
@wiking | the problem here is rether | 19:51 |
@wiking | *rather | 19:51 |
@wiking | SG_ADD((CSGObject**) &kernel, "kernel", "", MS_AVAILABLE); | 19:51 |
@wiking | we agree on this right? | 19:51 |
@wiking | because actually what you say is to the fw is that its and SGO | 19:51 |
@wiking | and actually you are killing yoruself in a way | 19:51 |
@wiking | because you loose this way the force typing | 19:52 |
@wiking | i.e. you could put there | 19:52 |
@wiking | CMachine* | 19:52 |
@wiking | if you pass it as SGO | 19:52 |
@wiking | :P | 19:52 |
@wiking | see what i mean | 19:52 |
@wiking | ? | 19:52 |
@HeikoS | yes true | 19:52 |
@wiking | so the registration sucks | 19:52 |
@HeikoS | the registration has to change | 19:52 |
@wiking | but | 19:52 |
@HeikoS | uh | 19:52 |
@wiking | this is solveable | 19:52 |
@wiking | with traits | 19:52 |
@HeikoS | bad | 19:52 |
@wiking | imo | 19:52 |
@wiking | just gimme couple of hours | 19:52 |
@HeikoS | complications | 19:52 |
@wiking | to hack it in there | 19:52 |
@HeikoS | then we cannot use SG_ADD | 19:52 |
@wiking | but imo the registration should be CKernel | 19:53 |
@wiking | not SGO | 19:53 |
@HeikoS | need to have a sep registration for tags | 19:53 |
@HeikoS | cant reuse SG_ADD | 19:53 |
@wiking | so that actually we can enforce there the right type | 19:53 |
@HeikoS | since that downcasts everytjhing | 19:53 |
@wiking | yeye | 19:53 |
@wiking | sure | 19:53 |
@wiking | i mean this is in middle hack atm | 19:53 |
@HeikoS | yeah enforcing the type for sgobject is a good thing | 19:53 |
@HeikoS | well maybe just make it work for kernel | 19:53 |
@HeikoS | its easy | 19:53 |
@wiking | no | 19:53 |
@HeikoS | just put a watch_param there | 19:53 |
@wiking | enforcing type of SGO | 19:53 |
@wiking | is a bad thing | 19:53 |
@wiking | :P | 19:53 |
@wiking | it should be lower derived class | 19:54 |
@wiking | unless its really needs to be sgo | 19:54 |
@HeikoS | yeah | 19:54 |
@HeikoS | register it as CKernel | 19:54 |
@wiking | i mean you get it that is fe remove | 19:54 |
@wiking | segey's typechecked has | 19:54 |
@wiking | all woudl work | 19:54 |
@HeikoS | cast it to kernel and all good | 19:54 |
@HeikoS | rather than sgobject | 19:54 |
@HeikoS | but need to remove that SG_ADD and replace with m_paramteters->add ... | 19:54 |
@HeikoS | and watch_param ... | 19:54 |
@wiking | ok | 19:55 |
@wiking | so | 19:55 |
@wiking | java has some shits | 19:55 |
@wiking | https://travis-ci.org/shogun-toolbox/shogun/jobs/338623705#L2189 | 19:55 |
@wiking | but i guess we are missing an import there | 19:55 |
@wiking | for DoubleMatrix | 19:55 |
@wiking | so can we tick 1)? | 19:56 |
@wiking | HeikoS, i mean not technically but theoretically | 19:56 |
@HeikoS | well once it works from the autogenerated cpp examples | 19:56 |
@wiking | as we can agree that its actually our fault | 19:56 |
@wiking | ok but you get what i mean no? | 19:56 |
@wiking | i mean its really just our own falut | 19:56 |
@wiking | as we enforce 2 different types | 19:57 |
@wiking | and the compiler just does what you tell it to do | 19:57 |
@HeikoS | if it works once you change the registration to CKernel* | 19:57 |
@HeikoS | but it should | 19:57 |
@HeikoS | so agree on the theory | 19:57 |
@HeikoS | :) | 19:57 |
@wiking | i mean i cannot register | 19:57 |
@wiking | CKernel with SG_ADD | 19:58 |
@wiking | or? | 19:58 |
@HeikoS | no | 19:58 |
@HeikoS | thats the thing | 19:58 |
@HeikoS | but no problemp | 19:58 |
@HeikoS | replace | 19:58 |
@HeikoS | SG_ADD((CSGObject**) &kernel, "kernel", "", MS_AVAILABLE); | 19:58 |
@HeikoS | by m_parameters-add((CSGObject**) &kernel, "kernel", "") | 19:58 |
@HeikoS | and throw an additional watch_parameter("kernel", &m_kernel) in there | 19:58 |
@HeikoS | think that should do it | 19:59 |
@HeikoS | ah | 19:59 |
@HeikoS | that will break some stuff | 19:59 |
@HeikoS | sigh | 19:59 |
@HeikoS | maybe it will work actually | 19:59 |
@HeikoS | try it :) | 19:59 |
@wiking | k | 19:59 |
@wiking | lemme check | 19:59 |
@HeikoS | i think it should work actually | 19:59 |
@HeikoS | syntax might have to be adjusted :) | 19:59 |
@HeikoS | this is KernelMachine.cpp::637 | 20:00 |
@HeikoS | wiking: I gotta run, will be back on it tomorrow | 20:00 |
@wiking | ok | 20:00 |
@wiking | ckernel doesn't work | 20:00 |
@HeikoS | with tags? | 20:01 |
@wiking | lemme try tags | 20:01 |
@HeikoS | ah yeah with old parameters it definitely doesnt work | 20:01 |
@HeikoS | ok running, bye | 20:01 |
@wiking | ? | 20:02 |
@wiking | /home/wiking/shogun/src/shogun/machine/KernelMachine.cpp:639:35: error: 'watch_parameter' was not declared in this scope | 20:02 |
@wiking | lemem grep | 20:02 |
@wiking | ok it's watch param | 20:02 |
@wiking | m_parameters->add((CKernel**) &kernel, "kernel", ""); | 20:03 |
@wiking | no good | 20:03 |
@wiking | i mean the point is | 20:03 |
@wiking | that it should be KERNEL | 20:03 |
@wiking | not SGO | 20:03 |
@wiking | :D | 20:03 |
@wiking | anyhow let me add the template hack for derived classes | 20:04 |
@wiking | gotta eat | 20:05 |
@wiking | i'll do this from home | 20:05 |
@wiking | ttyl | 20:05 |
-!- HeikoS [~heiko@untrust-out.swc.ucl.ac.uk] has quit [Ping timeout: 248 seconds] | 20:06 | |
-!- travis-ci [~travis-ci@ec2-54-204-229-205.compute-1.amazonaws.com] has joined #shogun | 20:44 | |
travis-ci | it's Viktor Gal's turn to pay the next round of drinks for the massacre he caused in shogun-toolbox/shogun: https://travis-ci.org/shogun-toolbox/shogun/builds/338623697 | 20:44 |
-!- travis-ci [~travis-ci@ec2-54-204-229-205.compute-1.amazonaws.com] has left #shogun [] | 20:44 | |
@sukey | [https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/2f488e4558fe3d84e3babaa670714f3bd35a5803 by vigsterkr | 23:06 |
-!- HeikoS [~heiko@host86-129-231-92.range86-129.btcentralplus.com] has joined #shogun | 23:48 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 23:48 | |
@sukey | [https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/8aa1737af03c2a42d9311ca46d578a486146ca9a by vigsterkr | 23:53 |
--- Log closed Thu Feb 08 00:00:53 2018 |
Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!