--- Log opened Tue Feb 06 00:00:50 2018 | ||
-shogun-buildbot:#shogun- Build osx1 - libshogun #246 is complete: Success [build successful] - http://buildbot.shogun-toolbox.org:8080/#builders/25/builds/246 | 01:08 | |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4130 merged by OXPHOS | 03:51 |
---|---|---|
@sukey | [https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/be16f3e7e388e850d0efa720cc0072eaed47d524 by OXPHOS | 03:51 |
-!- travis-ci [~travis-ci@ec2-54-159-51-80.compute-1.amazonaws.com] has joined #shogun | 04:24 | |
travis-ci | it's Wuwei Lin'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/337844428 | 04:24 |
-!- travis-ci [~travis-ci@ec2-54-159-51-80.compute-1.amazonaws.com] has left #shogun [] | 04:24 | |
-!- travis-ci [~travis-ci@ec2-54-159-51-80.compute-1.amazonaws.com] has joined #shogun | 05:02 | |
travis-ci | it's Wuwei Lin'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/337844428 | 05:02 |
-!- travis-ci [~travis-ci@ec2-54-159-51-80.compute-1.amazonaws.com] has left #shogun [] | 05:02 | |
-shogun-buildbot:#shogun- Build nightly_all #89 is complete: Success [build successful] - http://buildbot.shogun-toolbox.org:8080/#builders/22/builds/89 | 07:40 | |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4085 synchronized by vinx13 | 07:51 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4085 synchronized by vinx13 | 07:52 |
-shogun-buildbot:#shogun- Build nightly_none #89 is complete: Success [build successful] - http://buildbot.shogun-toolbox.org:8080/#builders/21/builds/89 | 09:24 | |
-!- HeikoS [~heiko@host86-129-231-92.range86-129.btcentralplus.com] has joined #shogun | 10:29 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 10:29 | |
@HeikoS | lisitsyn: jo! | 10:48 |
lisitsyn | HeikoS: reggelt? :) | 10:48 |
@HeikoS | reggelt? :D | 10:48 |
lisitsyn | jo reggelt! | 10:48 |
lisitsyn | ok ok | 10:48 |
@HeikoS | what does that mean? | 10:48 |
lisitsyn | sup | 10:48 |
@HeikoS | supsup | 10:48 |
@HeikoS | so | 10:48 |
lisitsyn | HeikoS: hungary left in past | 10:48 |
lisitsyn | :) | 10:48 |
@HeikoS | I thought more about the api thingi | 10:49 |
lisitsyn | ok tell me | 10:49 |
@HeikoS | I think the meta grammar should not influence api decisions | 10:49 |
@HeikoS | so happy to modify that | 10:49 |
@HeikoS | thats thought 1 | 10:49 |
@HeikoS | thought2 | 10:50 |
@HeikoS | this api is type free ... everything is runtime based | 10:50 |
@HeikoS | so why enforce types in the api itself? | 10:50 |
@HeikoS | no point in my eyes | 10:50 |
lisitsyn | yeah it is true | 10:50 |
@HeikoS | I think there should be a "put", and you can give it whatever you want | 10:50 |
lisitsyn | uhmm | 10:51 |
lisitsyn | it is a bit more complex | 10:51 |
@HeikoS | and then it tries to match things inside, if that doesnt work, you get an error | 10:51 |
@HeikoS | from an API perspective that is | 10:51 |
@HeikoS | put("kernel", k) | 10:51 |
lisitsyn | in most languages there is no 'Object' that is parent to everyone | 10:51 |
@HeikoS | but we can pass SGObject | 10:51 |
@HeikoS | no? | 10:51 |
lisitsyn | int, float, SGVector, .. | 10:52 |
@HeikoS | I mean we can have putVector etc | 10:52 |
@HeikoS | but putKernel? | 10:52 |
@HeikoS | why not just putObject ? and then the casting/matching is done inside | 10:52 |
lisitsyn | ok agree | 10:52 |
lisitsyn | so int,float,..., SGVector, SGObject* | 10:52 |
@HeikoS | yeah | 10:53 |
lisitsyn | sounds good to me | 10:53 |
@HeikoS | so how to implement that putObject thing? | 10:53 |
@HeikoS | we have it in SWIG already I think | 10:53 |
lisitsyn | kind of easy | 10:53 |
@HeikoS | SUPPORT_TAG(Object, object, CSGObject*) | 10:53 |
lisitsyn | yes swig already tries to dynamic cast them | 10:53 |
@HeikoS | the only remaining q is | 10:53 |
@HeikoS | where to implement these methods | 10:53 |
lisitsyn | the only problem is that tags do not support it yet | 10:53 |
@HeikoS | as if we do it in SWIG only, then the API differs from c++ | 10:54 |
lisitsyn | because it tries to assign different types and then fails | 10:54 |
lisitsyn | no, it should be in SGOBject I believe | 10:54 |
lisitsyn | I like idea of having the same interface | 10:54 |
@HeikoS | yeah I think I agree | 10:54 |
@HeikoS | so for every primitive type that Shogun supports, there is a method in SGObject | 10:54 |
lisitsyn | yes | 10:55 |
@HeikoS | void CSGObject::putKernel(const std::string& name, CKernel* value) | 10:55 |
@HeikoS | { | 10:55 |
@HeikoS | CSGObject::put<CSGObject*>(name, (CSGObject*)value); | 10:55 |
@HeikoS | } | 10:55 |
@HeikoS | and then the downcasting just happens in there | 10:55 |
lisitsyn | we don't need putKernel anymore | 10:55 |
lisitsyn | :) | 10:55 |
@HeikoS | sorry | 10:55 |
@HeikoS | make that putObject | 10:55 |
lisitsyn | yeah | 10:55 |
lisitsyn | ok | 10:55 |
@HeikoS | will swig realise that you can pass a kernel to sgobject pointer? | 10:55 |
lisitsyn | HeikoS: but we need to patch any | 10:55 |
lisitsyn | :) | 10:55 |
@HeikoS | ah yeah I thought that | 10:55 |
@HeikoS | ok | 10:55 |
lisitsyn | HeikoS: swig realizes that CKernel -> CSGObject | 10:55 |
lisitsyn | but | 10:55 |
lisitsyn | tags stuff would try to assign CSGObject to CKernel and fail | 10:56 |
lisitsyn | so it should try to cast back | 10:56 |
lisitsyn | if it worked yaya! | 10:56 |
@HeikoS | is that possible? | 10:56 |
lisitsyn | yeah just do dynamic_cast | 10:56 |
lisitsyn | in case of pointers | 10:56 |
@HeikoS | kk | 10:56 |
@HeikoS | can you patch that? | 10:57 |
@HeikoS | I will add the methods and clean up the SGBase.i | 10:57 |
@HeikoS | lisitsyn: and then finally. the kwargs in the meta examples | 10:57 |
lisitsyn | I will check some day this week | 10:57 |
@HeikoS | it needs to be typed | 10:57 |
@HeikoS | that is annoying | 10:57 |
@HeikoS | but we cannot avoid this I think | 10:57 |
lisitsyn | not really | 10:57 |
lisitsyn | for python you can dispatch types | 10:57 |
lisitsyn | we can write simple method to do that | 10:57 |
@HeikoS | ok but that is fine since it is only the meta example, not the generated listing | 10:57 |
@HeikoS | and in python, we can dispatch it nicely | 10:58 |
@HeikoS | but for the langs where that doesnt work, we need to translate typed | 10:58 |
@HeikoS | KernelMachine svm = kernel_machine("LibSVM", Float C1=2.0, Kernel kernel=k) | 10:58 |
@HeikoS | something like this | 10:58 |
lisitsyn | uh | 10:58 |
lisitsyn | probably yes | 10:59 |
@HeikoS | and that can be parsed and translated to both putFloat, putObject, ... and to dispatch way as in python | 10:59 |
@HeikoS | I now just wonder | 10:59 |
lisitsyn | oh well | 10:59 |
@HeikoS | is that nicer than having a new line for every parameter? : | 10:59 |
lisitsyn | :) | 10:59 |
@HeikoS | what do you think? | 10:59 |
@HeikoS | is it worth the trouble? | 10:59 |
@HeikoS | what we get from this is that we can do kwargs for dispatchable langs | 10:59 |
@HeikoS | i.e. python examples will be much neater | 10:59 |
lisitsyn | uhmm I think it is worth it | 11:00 |
@HeikoS | ok | 11:00 |
lisitsyn | I mean we have to add types anyway | 11:00 |
@HeikoS | kk | 11:00 |
lisitsyn | ahh btw | 11:00 |
lisitsyn | stahp! | 11:00 |
lisitsyn | :) | 11:00 |
@HeikoS | stahp? | 11:00 |
lisitsyn | "stop" | 11:00 |
lisitsyn | :) | 11:00 |
lisitsyn | having settled | 11:00 |
lisitsyn | that we only have SGObject | 11:00 |
lisitsyn | it is actually possible to use overloading! | 11:01 |
@HeikoS | explain plssss | 11:01 |
lisitsyn | put(string, int) | 11:01 |
lisitsyn | put(string, float) | 11:01 |
@HeikoS | http://i0.kym-cdn.com/entries/icons/original/000/011/089/stahp.jpg | 11:01 |
lisitsyn | put(string, Vector<int>) | 11:01 |
lisitsyn | put(string, SGObject*) | 11:01 |
lisitsyn | they are non-ambiguous | 11:01 |
@HeikoS | ahaaa! | 11:01 |
lisitsyn | this means we don't need types | 11:02 |
lisitsyn | I think it should work in all the target languages | 11:02 |
@HeikoS | it doesnt yet | 11:02 |
@HeikoS | but maybe that is due to the missing dynamic_cast in any? | 11:02 |
lisitsyn | yes | 11:02 |
lisitsyn | we just need to check if it works in all the languages | 11:03 |
lisitsyn | so it is overloading + runtime check for SGObjects | 11:03 |
@HeikoS | yes | 11:03 |
lisitsyn | hybrid | 11:03 |
lisitsyn | :P | 11:03 |
@HeikoS | so, as said yesterday | 11:04 |
@HeikoS | it works in python and java ( i think) | 11:04 |
@HeikoS | but not c++ or octave | 11:04 |
lisitsyn | really? | 11:04 |
@HeikoS | mmmh | 11:04 |
@HeikoS | maybe I got lost | 11:04 |
@HeikoS | let me find | 11:04 |
lisitsyn | I mean C++ | 11:04 |
lisitsyn | :) | 11:04 |
lisitsyn | oh well it is easy to check | 11:04 |
lisitsyn | let me figure a toy example | 11:04 |
@HeikoS | I have one | 11:04 |
@HeikoS | Ill do it | 11:04 |
@HeikoS | just a sec | 11:05 |
@wiking | muthafu | 11:05 |
@wiking | ]http://kripken.github.io/emscripten-site/docs/porting/connecting_cpp_and_javascript/embind.html#deriving-from-c-classes-in-javascript | 11:05 |
@wiking | :) | 11:05 |
@wiking | welcome to director classes in js | 11:06 |
@HeikoS | lisitsyn: so c++, java, python work | 11:07 |
@HeikoS | octave doesnt | 11:07 |
lisitsyn | https://ideone.com/YcAQHe | 11:07 |
@HeikoS | ah wait | 11:07 |
lisitsyn | HeikoS: ^ cpp sorta works | 11:08 |
lisitsyn | :) | 11:08 |
@HeikoS | actually | 11:08 |
@HeikoS | octave also works | 11:08 |
@HeikoS | but not for floats | 11:08 |
@HeikoS | but object works | 11:08 |
lisitsyn | float/double? | 11:08 |
lisitsyn | I'd expect some lang to fail with float and double | 11:08 |
@HeikoS | yeah the float is issue | 11:08 |
@HeikoS | yes | 11:08 |
lisitsyn | but I believe we should just provide double | 11:08 |
lisitsyn | :) | 11:08 |
lisitsyn | or float | 11:08 |
@HeikoS | yep | 11:08 |
@HeikoS | only double | 11:08 |
@HeikoS | everything is copied | 11:08 |
@HeikoS | so we can add expicit cast ? | 11:09 |
lisitsyn | I need to hack any | 11:09 |
lisitsyn | to support assigning float = double | 11:09 |
@HeikoS | yep | 11:09 |
lisitsyn | and CKernel = CSGObject | 11:09 |
@HeikoS | same for int I think | 11:09 |
@HeikoS | CKernel = CSGObject works | 11:09 |
lisitsyn | eh?? | 11:09 |
lisitsyn | how | 11:09 |
lisitsyn | :D | 11:09 |
lisitsyn | ah | 11:10 |
lisitsyn | hahah | 11:10 |
lisitsyn | HeikoS: we register everything as CSGObject** | 11:10 |
lisitsyn | that's whhy it works | 11:10 |
lisitsyn | lol | 11:10 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4085 synchronized by vinx13 | 11:10 |
lisitsyn | that's in SG_ADD | 11:10 |
@HeikoS | yep :D | 11:10 |
@HeikoS | static casts everywhere | 11:10 |
@HeikoS | I think it is the same motivation as we have here in fact | 11:10 |
lisitsyn | it is actually good | 11:10 |
lisitsyn | not the same but something covariant | 11:11 |
lisitsyn | okok all good | 11:11 |
@HeikoS | yeah | 11:11 |
lisitsyn | HeikoS: so we just need float=double things to make it work in octave and similar langs | 11:11 |
@HeikoS | yes I think | 11:12 |
lisitsyn | then we add put(string, {int,float,...}) | 11:12 |
@HeikoS | and what would really help is also: | 11:12 |
@HeikoS | SG_ERROR("Type error when setting parameter %s::%s: expected %s but got %s.\n", | 11:12 |
@HeikoS | get_name(), _tag.name().c_str(), | 11:12 |
@HeikoS | "X", "Y"); | 11:12 |
lisitsyn | yes I remember | 11:12 |
lisitsyn | :) | 11:12 |
@HeikoS | lisitsyn: what do you mean "we add put ... "? | 11:12 |
@HeikoS | I mean the methods are there | 11:12 |
lisitsyn | HeikoS: explicit | 11:12 |
@HeikoS | you mean we only instantiate the template for these types? | 11:12 |
lisitsyn | HeikoS: which actually is super good because finally | 11:13 |
lisitsyn | we can move templated code to .cpp | 11:13 |
@HeikoS | yep | 11:13 |
@HeikoS | I am just thinking | 11:13 |
lisitsyn | should speed up compilation quite a bit | 11:13 |
@HeikoS | why don't we do the casting in there? | 11:13 |
@HeikoS | and leave any how it is? | 11:13 |
lisitsyn | ? | 11:13 |
lisitsyn | in where? | 11:13 |
@HeikoS | like add explicit template for float_t and cast to float64_t in there | 11:13 |
lisitsyn | ah | 11:13 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4085 | 11:13 |
lisitsyn | we can | 11:13 |
@HeikoS | maybe more explicit? | 11:14 |
lisitsyn | but we don't know the type of parameter | 11:14 |
lisitsyn | it is better | 11:14 |
@HeikoS | ah you mean | 11:14 |
lisitsyn | this way we have to agree | 11:14 |
lisitsyn | we register everything as double | 11:14 |
@HeikoS | we should always cast *any* float value to the float type of the underlying parameter? | 11:14 |
lisitsyn | or we register everything as float | 11:14 |
@HeikoS | mmmh I wouldnt do that I think | 11:14 |
@wiking | lisitsyn, fyi https://chromium.googlesource.com/external/github.com/kripken/emscripten/+/1.35.20/system/include/emscripten/bind.h#560 | 11:14 |
lisitsyn | otherwise we don't know | 11:14 |
@HeikoS | I would register is dev decises | 11:14 |
@HeikoS | but then try to convert | 11:14 |
@HeikoS | so user can give anything | 11:15 |
lisitsyn | yeah but currently it just checks if it is the same type | 11:15 |
@HeikoS | but it is converted to the registered type | 11:15 |
lisitsyn | so it might be float or double | 11:15 |
lisitsyn | well we can try both :D :D | 11:15 |
lisitsyn | or patch any to support assigning convertible types | 11:15 |
@HeikoS | yeah | 11:15 |
@HeikoS | I think I would do that expicitly | 11:15 |
lisitsyn | yes but how? | 11:15 |
@HeikoS | otherwise this is lost in translation | 11:15 |
@HeikoS | can't we have a real_t instantiation of put | 11:15 |
@HeikoS | that tries put<float>, put<double>, etc? | 11:16 |
lisitsyn | uh | 11:16 |
@HeikoS | maybe not most elegant | 11:16 |
@HeikoS | well we can patch any to accept assignment from different type then | 11:16 |
@wiking | Trixis, i'll merge just lemme check the cis | 11:17 |
lisitsyn | HeikoS: it should be possible | 11:17 |
lisitsyn | let me get back with that issue later | 11:17 |
@wiking | going? | 11:17 |
lisitsyn | at least we can do it two ways | 11:17 |
@HeikoS | lisitsyn: kk | 11:17 |
@wiking | Trixis, how's the jni going? | 11:17 |
@HeikoS | lisitsyn: ah I like this much more | 11:18 |
@HeikoS | just to have a single "put" | 11:18 |
@HeikoS | lisitsyn: let me know, would be good to get this sorted soon, since then it unblocks a whole bunch of stuff I could work on | 11:18 |
-!- wuwei_ [ca781368@gateway/web/freenode/ip.202.120.19.104] has joined #shogun | 11:20 | |
-!- wuwei_ [ca781368@gateway/web/freenode/ip.202.120.19.104] has quit [Client Quit] | 11:21 | |
Trixis | wiking: working on it, writing the java code | 11:26 |
Trixis | wiking: trying to figure out where the pragmas go | 11:26 |
@wiking | Trixis, mmm one thing though | 11:26 |
Trixis | ye? | 11:26 |
@wiking | have you seen the unofficial tf j wrapper? | 11:26 |
Trixis | nope | 11:27 |
@wiking | ok so that is educational | 11:27 |
@wiking | :) | 11:27 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4153 merged by vigsterkr | 11:29 |
@sukey | [https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/56ae5e1c3f712fdcd7cc16f3287071b4a68c4173 by vigsterkr | 11:29 |
Trixis | wiking: so the tensorflow java wrapper seems to require the jni to be passed in path? | 11:33 |
@wiking | tensorflow/java/src/main/java/org/tensorflow/NativeLibrary.java | 11:35 |
@wiking | and of course | 11:35 |
@wiking | static void init() { | 11:35 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 opened by karlnapf | 11:36 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 | 11:36 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 | 11:36 |
@wiking | NativeLibrary.load(); | 11:37 |
@wiking | } | 11:37 |
@wiking | static { | 11:37 |
@wiking | init(); | 11:37 |
@wiking | } | 11:37 |
@wiking | in classes | 11:37 |
@wiking | i mean that's in main class | 11:37 |
@wiking | static { | 11:37 |
@wiking | TensorFlow.init(); | 11:37 |
@wiking | } | 11:37 |
@wiking | in others | 11:37 |
@wiking | https://github.com/tensorflow/tensorflow/blob/master/tensorflow/java/src/main/java/org/tensorflow/NativeLibrary.java | 11:37 |
@wiking | Trixis, https://github.com/tensorflow/tensorflow/blob/master/tensorflow/java/src/main/java/org/tensorflow/NativeLibrary.java | 11:37 |
@wiking | Trixis, thi sis the typical way of loading jni from resources | 11:39 |
Trixis | wiking: so yeah you extract it into temp dir | 11:43 |
Trixis | and load it from there | 11:44 |
@wiking | i mean you can copy paste this easy | 11:45 |
@wiking | :) | 11:45 |
Trixis | heh fair | 11:45 |
Trixis | i was thinking of making it tidier with .nio (you could use .nio Files.createTempDirectory so that you dont have to deal with system properties) but sure :) | 11:45 |
@wiking | cool | 11:51 |
@wiking | i mean if you have nicer ways that's fine | 11:51 |
@wiking | btw | 11:51 |
@wiking | you should aim 1.7 | 11:52 |
@wiking | but maybe even 1.8 | 11:52 |
@wiking | as 1.7 is EOL | 11:52 |
@wiking | Trixis, jdk that is | 11:52 |
@wiking | HeikoS, https://github.com/shogun-toolbox/shogun/pull/4085/files#r166255523 | 11:52 |
@HeikoS | wiking: ++ | 11:55 |
@HeikoS | wiking: I remember discussing with s?ren, asking why not using dynamic_cast, and he said it was too slow .... | 11:55 |
@HeikoS | but this is the init method ... only called once anyways | 11:55 |
@HeikoS | I would just do everything with exceptions | 11:56 |
@HeikoS | try to use the given thing and if it doesnt work, throw exception | 11:56 |
@HeikoS | proper runtime typing | 11:56 |
@wiking | i disagree with the enum | 11:58 |
@wiking | they are indeed good | 11:58 |
@wiking | as you can actually check without dynamic casting | 11:58 |
@wiking | and assure the types | 11:59 |
@wiking | indeed casting is not really waht you wanna rely on too much | 12:02 |
@wiking | as it make things indeed slower | 12:03 |
@wiking | this way you can do the compatible type checking etc | 12:03 |
@HeikoS | but too many types | 12:04 |
@HeikoS | why not make it a sring? | 12:04 |
@HeikoS | string | 12:04 |
@wiking | lol? | 12:04 |
@wiking | are you serious that you wanna do strcmp? | 12:05 |
@HeikoS | I mean type checking doesnt happen inside algorithms | 12:05 |
@wiking | let's not make everything soooo pythonic | 12:05 |
@wiking | HeikoS, well in this case it does | 12:05 |
@wiking | it actually tests the types that they are compatible etc | 12:05 |
@wiking | you can enumerate over enums | 12:06 |
@wiking | whereas comparing strings is n more operations | 12:06 |
@wiking | and its prone to error | 12:06 |
@wiking | this way you fix the type | 12:06 |
@HeikoS | sure it is more expensive | 12:06 |
@HeikoS | but you only do that once | 12:06 |
@wiking | and even the compiler does you many checks | 12:06 |
@wiking | right away | 12:06 |
@wiking | yeah but many | 12:06 |
@wiking | *man | 12:06 |
@wiking | use the compielr | 12:06 |
@HeikoS | I don't like these hundreds of enums at all | 12:07 |
@wiking | there's gonna be just errors | 12:07 |
@wiking | all over | 12:07 |
@wiking | if you start using strings for type description | 12:07 |
@HeikoS | can use the compiler | 12:07 |
@HeikoS | but no enums | 12:07 |
@HeikoS | dynamic_cast | 12:07 |
@wiking | ? | 12:07 |
@wiking | no | 12:08 |
@wiking | that's not the same | 12:08 |
@wiking | :) | 12:08 |
@HeikoS | imo, the only advantage that enums have in this particular case is that compiling detects typos | 12:08 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4085 synchronized by vinx13 | 12:09 |
@HeikoS | but otherwise, I don't see the advantage | 12:09 |
@HeikoS | especially the speed argument | 12:09 |
@wiking | what do you mean speed argument? | 12:09 |
@HeikoS | that it is faster to check enums | 12:09 |
@wiking | way faster yes | 12:09 |
@HeikoS | if one does type checking inside a loop, something is wrong with the algorithm design | 12:09 |
@wiking | mmmm | 12:09 |
@HeikoS | so I of course wouldnt do that with strings | 12:10 |
@wiking | vbut even in that case | 12:10 |
@wiking | say that its not the same speed | 12:10 |
@HeikoS | we have lots of this stuff | 12:10 |
@HeikoS | REQUIRE( lhs->get_feature_class() == C_DENSE, "Left hand side (was %s) has to be CDenseFeatures instance.\n", lhs->get_name()); | 12:10 |
@HeikoS | and I think that is not good | 12:10 |
@wiking | well if you start with a base class | 12:10 |
@HeikoS | should be done with base classes | 12:10 |
@wiking | there's not much really you can do | 12:11 |
@HeikoS | yeah sure need to do the check | 12:11 |
@HeikoS | but what does the enum buy you here? | 12:11 |
@HeikoS | doing this check once? | 12:11 |
@HeikoS | anyways | 12:11 |
@HeikoS | not important | 12:11 |
@wiking | you can enumerate and its fixed | 12:11 |
@wiking | for you | 12:11 |
@HeikoS | but we never do that | 12:11 |
@wiking | ... | 12:11 |
@wiking | i mean man i dont get it | 12:11 |
@wiking | we start a discussion here | 12:11 |
@wiking | about something and you say in the middle of it | 12:12 |
@wiking | that it's not important | 12:12 |
@wiking | fine | 12:12 |
@HeikoS | well ok | 12:12 |
@wiking | if it's not then why do you bother to start it? | 12:12 |
@HeikoS | so where do we iterate over enums? | 12:12 |
@wiking | i'm sayig that a | 12:12 |
@wiking | it has the advantage of switch() | 12:12 |
@wiking | as well as fixes types | 12:13 |
@HeikoS | it has | 12:13 |
@HeikoS | but we dont do that | 12:13 |
@wiking | i.e. you can rely on typechecking | 12:13 |
@wiking | of typechekcing | 12:13 |
@wiking | lhs->get_feature_class() == C_DENSE | 12:13 |
@wiking | this is relying on compiler | 12:13 |
@wiking | C_DENSEMYCUSTOMTYPE | 12:13 |
@wiking | will fail | 12:13 |
@wiking | as soon as you do it | 12:13 |
@HeikoS | sure, that's what I said above, it detects typos | 12:14 |
@wiking | unless you declare that type | 12:14 |
@wiking | as well as you can query the types | 12:14 |
@wiking | right? | 12:14 |
@HeikoS | you can | 12:14 |
@HeikoS | but we dont dpo that | 12:14 |
@wiking | you just do it | 12:14 |
@wiking | REQUIRE( lhs->get_feature_class() == C_DENSE, "Left hand side (was %s) has to be CDenseFeatures instance.\n", lhs->get_name()); | 12:14 |
@wiking | same for features | 12:14 |
@wiking | as well as machines | 12:14 |
@wiking | git grep get_feature_class|wc -l | 12:15 |
@wiking | 243 | 12:15 |
@HeikoS | I think one could get away with a simpler comparison in these cases | 12:16 |
@wiking | HeikoS, like? | 12:16 |
@HeikoS | string :D | 12:16 |
@wiking | i mean i'm not so sure | 12:16 |
@wiking | what is simpler | 12:16 |
@wiking | than a byte | 12:16 |
@HeikoS | error messages would also be neater | 12:17 |
@HeikoS | since once can print the type | 12:17 |
@HeikoS | for enums we need to define another to_string thing | 12:17 |
@HeikoS | so we have confusing error messages alover | 12:17 |
@HeikoS | "expected type was 20, but needs to be DENSE" | 12:17 |
@wiking | HeikoS, i think you are mixing 2 things here | 12:18 |
@wiking | one is the enum | 12:18 |
@wiking | and the other is how these are being checked and printed | 12:18 |
@wiking | the REQUIRED | 12:18 |
@wiking | is a shitty design | 12:18 |
@wiking | especially that it's a macro | 12:18 |
@HeikoS | I am just saying that if we used a string, we neither had to define all these types, and also wouldn't have to define lots of to_string methods, so it would be a bit cleaner. And this does not come at a severe cost. | 12:19 |
@wiking | yes | 12:19 |
@wiking | it is a server cost | 12:19 |
@wiking | that you start having problems with | 12:19 |
@HeikoS | and the downsides are not that bad imo | 12:19 |
@wiking | content | 12:19 |
@wiking | of strings | 12:19 |
@wiking | :) | 12:19 |
@HeikoS | yeah sure | 12:19 |
@HeikoS | typos etc | 12:19 |
@wiking | utf8 or utf16 | 12:19 |
@wiking | or ascii | 12:19 |
@wiking | ? | 12:19 |
@wiking | or which string exactly | 12:19 |
@wiking | you mean here? | 12:19 |
@wiking | as you know c++ does not really have a standard | 12:20 |
@wiking | around that | 12:20 |
@wiking | which strcmp do you wanna call | 12:20 |
@HeikoS | I am more talking about shogun's particular use cases | 12:20 |
@HeikoS | not general | 12:20 |
@wiking | for utf8 or utf16? | 12:20 |
@HeikoS | I am not talking general about this | 12:20 |
@HeikoS | but just for Shogun | 12:20 |
@wiking | yes | 12:20 |
@wiking | in shogun | 12:20 |
@HeikoS | for those feature type checks | 12:20 |
@wiking | if you do this | 12:20 |
@wiking | which string you gonna be passing around | 12:20 |
@wiking | ? | 12:20 |
@HeikoS | the same as we use in get_name | 12:20 |
@HeikoS | or a modern version of that | 12:20 |
@wiking | i dont understand why is it not easier | 12:20 |
@wiking | to make a template for this | 12:21 |
@wiking | and make it work | 12:21 |
@wiking | instead of starting using | 12:21 |
@HeikoS | can do as well | 12:21 |
@HeikoS | of course | 12:21 |
@wiking | utf8 strings to actually do the job | 12:21 |
@wiking | i mean not understanding and using a language | 12:21 |
@wiking | should not mean that you are using | 12:21 |
@wiking | 3 constructs | 12:21 |
@wiking | string | 12:21 |
@wiking | map | 12:21 |
@wiking | list | 12:21 |
@wiking | like in python | 12:21 |
@wiking | no offence | 12:21 |
@HeikoS | wow | 12:22 |
@HeikoS | I think I don't have anything more to add then | 12:22 |
@wiking | i mean you wanna exchange a strictly type thing for a dynamic content | 12:22 |
@wiking | to actually check a dynamic content | 12:23 |
@wiking | that's what you are proposing here | 12:23 |
@wiking | sure things could be improved around REQUIRE | 12:23 |
@wiking | but that's not how you store information | 12:23 |
@wiking | but how you extract | 12:23 |
@HeikoS | lisitsyn: looks like the downcasting also needs to be addressed in any: https://travis-ci.org/shogun-toolbox/shogun/jobs/337947153#L5111 | 12:30 |
@wiking | https://ideone.com/PZYvG6 | 12:34 |
@wiking | this is the most c99 solution for you problem | 12:34 |
@wiking | and you could as well just do a typecasting for std::string instead of os | 12:34 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 synchronized by karlnapf | 12:35 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4155 opened by karlnapf | 13:16 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 synchronized by karlnapf | 13:17 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4155 | 13:18 |
lisitsyn | what enums are you talking about? | 13:39 |
lisitsyn | HeikoS: ok I now understand why you want these types in errors :) | 13:39 |
@HeikoS | lisitsyn: :D | 13:55 |
@HeikoS | lisitsyn: https://github.com/shogun-toolbox/shogun/pull/4154/files#diff-64897fcc9c6881619a736495fa60f9cdR31 | 13:55 |
@HeikoS | actually, cpp is the *only* one that doesnt work here | 13:55 |
lisitsyn | HeikoS: do you have the generated code somewhere? | 13:56 |
@HeikoS | kernel("GaussianKernel") return CKernel* but the "kernel" is registered as CSGObject* | 13:56 |
@HeikoS | suer | 13:56 |
@HeikoS | sure | 13:56 |
@HeikoS | lisitsyn: https://gist.github.com/karlnapf/8f6444c40dad4010f3c0da02b2057a93 | 13:58 |
@HeikoS | gna | 13:58 |
@HeikoS | wait | 13:58 |
lisitsyn | HeikoS: ah ok I get it | 13:58 |
lisitsyn | so we call put | 13:58 |
lisitsyn | it derives T=CKernel* | 13:58 |
@HeikoS | updated | 13:59 |
@HeikoS | yes | 13:59 |
lisitsyn | okie | 13:59 |
@HeikoS | I think this is solved if we make template explicit | 13:59 |
lisitsyn | yes | 13:59 |
@HeikoS | and only allow SGObject | 13:59 |
lisitsyn | exactly | 13:59 |
lisitsyn | yes | 13:59 |
@HeikoS | I am just doing that | 13:59 |
lisitsyn | HeikoS: try explicit | 13:59 |
@HeikoS | but since you are hacking any | 13:59 |
lisitsyn | I think it might have higher priority | 13:59 |
@HeikoS | I think we should be consistent with where we restrict the API types | 13:59 |
lisitsyn | HeikoS: but not sure | 13:59 |
lisitsyn | HeikoS: in the interface | 13:59 |
@HeikoS | either do it in any or in explicit template | 13:59 |
lisitsyn | HeikoS: explicit template is better | 14:00 |
@HeikoS | also the float? | 14:00 |
lisitsyn | yes | 14:00 |
lisitsyn | all or nothing | 14:00 |
lisitsyn | you have to :( | 14:00 |
lisitsyn | HeikoS: I can explain why :) | 14:00 |
lisitsyn | compilation speed and swig | 14:00 |
@HeikoS | yeah | 14:00 |
@HeikoS | also less subtle and convoluted | 14:01 |
@HeikoS | lisitsyn: how do I deal with nested templates? | 14:03 |
@HeikoS | I mean like SGVector<T> | 14:03 |
lisitsyn | HeikoS: explicit.. | 14:03 |
lisitsyn | :) | 14:03 |
lisitsyn | everything | 14:03 |
@HeikoS | jipiee! | 14:04 |
lisitsyn | HeikoS: yes a lot of copy paste | 14:04 |
lisitsyn | *but* | 14:04 |
lisitsyn | it will work with swig flawlessly | 14:04 |
@HeikoS | good thing is | 14:04 |
lisitsyn | because renames didn't work at all | 14:04 |
lisitsyn | for SGVector | 14:04 |
@HeikoS | i have that macro in .cpp now | 14:04 |
lisitsyn | I stopped at the point of it no-working | 14:04 |
@HeikoS | so easy to extend :D | 14:04 |
@HeikoS | hehe | 14:04 |
@HeikoS | the macro is still needed otherwise things dont work | 14:04 |
@HeikoS | but I will see with that later | 14:04 |
lisitsyn | HeikoS: swig didn't handle renames with nested templates | 14:04 |
@HeikoS | ah yeah I didnt get there yet | 14:05 |
@HeikoS | lisitsyn: ah that is actually great | 14:05 |
@HeikoS | since we dont get explosion in names | 14:05 |
@HeikoS | lisitsyn: enum above was about FT_REAL FT_SHORT FT_STRING etc | 14:06 |
@HeikoS | if(get_feature_type()==FT_REAL) then bla | 14:06 |
@HeikoS | lisitsyn: | 14:08 |
@HeikoS | template <typename T, typename U = void> | 14:08 |
@HeikoS | void put(const std::string& name, const T& value) throw(ShogunException); | 14:08 |
@HeikoS | why the U=void in the string based put? | 14:08 |
-!- iglesias [503877bd@gateway/web/freenode/ip.80.56.119.189] has joined #shogun | 14:09 | |
@wiking | you could have traits | 14:10 |
@wiking | would this be acceptable for you or you dont wanna actually even be bothered by converting to types adn what that to happen automagically? | 14:12 |
@wiking | REQUIRE(features->get_feature_class()==C_DENSE, | 14:12 |
@wiking | "Provided features (%s) has to be of C_DENSE (%s) class!\n", | 14:12 |
@wiking | to_string(features->get_feature_class()), to_string(C_DENSE)); | 14:12 |
lisitsyn | HeikoS: two templated methods with the same signature | 14:12 |
lisitsyn | so they have additional fake template parameter | 14:12 |
@HeikoS | ah! | 14:12 |
@HeikoS | wiking: i think either to_string or the << overloading is fine | 14:12 |
@wiking | i mean the problem is that in SGIO we still use | 14:13 |
@wiking | bad ass c99 snprintf | 14:13 |
@wiking | and since we use strformating | 14:13 |
@wiking | see "Provided features (%s) has to be of C_DENSE (%s) class!\n", | 14:13 |
@HeikoS | yep | 14:13 |
@wiking | the operator story would be a bit awkwardy | 14:13 |
@wiking | doable | 14:14 |
@wiking | as one could do | 14:14 |
@wiking | for (v: varargs ) stringbuf << v; s = stringbuf.str() | 14:14 |
@wiking | and since it happens at the backend you dont care | 14:14 |
@HeikoS | I did this as a quick hack before https://github.com/shogun-toolbox/shogun/blob/develop/tests/unit/base/SGObjectAll_unittest.cc#L43 | 14:14 |
@wiking | but as there's already string formatting | 14:15 |
@wiking | i.e. you stilll wanan control the type that is being printed | 14:15 |
@wiking | HeikoS, could you stop doing this | 14:15 |
@wiking | https://github.com/shogun-toolbox/shogun/blob/develop/tests/unit/base/SGObjectAll_unittest.cc#L48 | 14:15 |
@wiking | ? | 14:15 |
@wiking | and actually just either have a mapping | 14:16 |
@wiking | in TSGData | 14:16 |
@wiking | type | 14:16 |
@wiking | because this is in a way | 14:16 |
@wiking | implemented many places | 14:16 |
@wiking | in different ways | 14:16 |
@HeikoS | yes | 14:16 |
@HeikoS | there is a method in SGOBject already | 14:16 |
@wiking | i.e. this is why i asked | 14:16 |
@HeikoS | set_generic | 14:16 |
@wiking | a week ago | 14:16 |
@wiking | what is the idea of TSGDataType | 14:16 |
@wiking | as if that goes fine | 14:16 |
@wiking | i dont wanna add stuff there | 14:16 |
@wiking | but if we still keep up with this | 14:16 |
@wiking | then we should just put stuff there | 14:17 |
@wiking | HeikoS, your problem with nested types mostly could be solved | 14:17 |
@wiking | with the serializeable magic vararg temple | 14:17 |
@wiking | HeikoS, btw feel free to add templates in unit tests | 14:17 |
@wiking | in headers | 14:17 |
@wiking | as that is not a big deal | 14:18 |
@wiking | (no swigstuff) | 14:18 |
@wiking | and plz make sure when you see a pr | 14:18 |
@wiking | that | 14:18 |
@wiking | https://github.com/shogun-toolbox/shogun/blob/develop/tests/unit/base/SGObjectAll_unittest.cc#L8 | 14:18 |
@wiking | is the first in includes | 14:18 |
@wiking | as gtest/gmock does a lot of magic macro stuff | 14:18 |
@wiking | and for exmaple they use I as a macro | 14:18 |
@wiking | which is as well a macro obviously in <complex> | 14:18 |
@HeikoS | ah yes, that explains why I had problems there | 14:18 |
@HeikoS | didnt know | 14:18 |
@wiking | and then it kabooom | 14:18 |
@wiking | i had like couple of | 14:19 |
@wiking | commmites | 14:19 |
@wiking | *commits | 14:19 |
@wiking | that moved those things around | 14:19 |
@wiking | mostly lambday codes had <gtest> somewhere at the last position | 14:19 |
@HeikoS | I had problems with the utils | 14:19 |
@HeikoS | couldnt figure it out | 14:19 |
@HeikoS | so good to know, thx | 14:19 |
@wiking | nw | 14:22 |
@wiking | btw about this enum and typechecking | 14:22 |
@wiking | maybe acutally the 'gordius knot could be cut' | 14:22 |
@wiking | the easiest way is what any does | 14:22 |
@HeikoS | wiking: so you think this horror should go to the datatype? https://github.com/shogun-toolbox/shogun/blob/develop/tests/unit/base/SGObjectAll_unittest.cc#L52 | 14:22 |
@wiking | meaning since that init is already a bit fucked i.e. that it would be better if it gives you back the actual typed value | 14:22 |
@wiking | if possible | 14:22 |
@wiking | otherwise throw error | 14:22 |
@HeikoS | I didnt put it because I didnt want to open that box for now, but just to add the test | 14:23 |
@wiking | then it would be better to do what any | 14:23 |
@wiking | is about | 14:23 |
@HeikoS | wiking: yep | 14:23 |
@HeikoS | this is my fav: https://github.com/shogun-toolbox/shogun/blob/develop/tests/unit/base/SGObjectAll_unittest.cc#L58 | 14:23 |
@wiking | get<ACtualType>(commonType) | 14:23 |
@wiking | and then that'll as well do the typechecking | 14:23 |
@wiking | and throw you a reasnable error | 14:23 |
@wiking | HeikoS, i have something for L52 for you | 14:23 |
@wiking | just a secc | 14:24 |
@wiking | lemme copypaste | 14:24 |
@wiking | if i did a git commit | 14:24 |
@wiking | hohahaha i did not but basicallhy | 14:24 |
@wiking | the idea was that you can generate a nice template map | 14:25 |
@wiking | for the these things | 14:25 |
@wiking | what you are doing there | 14:25 |
@wiking | and actually some of it you can nicely do | 14:25 |
@wiking | with typetraits | 14:25 |
@wiking | for example for EContainerType | 14:25 |
@wiking | as you often would do shit like | 14:25 |
@wiking | figuring out the SGVector's EPrimitiveType and EContainerType | 14:26 |
@wiking | or any particular variable | 14:26 |
@HeikoS | yeah, all that should be in the datatype | 14:26 |
@wiking | i can port that from the cereal branch | 14:27 |
@wiking | if we really | 14:27 |
@wiking | dont wanna kill | 14:27 |
@HeikoS | for both finding out and stringing ... | 14:27 |
@wiking | the shole datatype | 14:27 |
@wiking | but i would do for casting | 14:27 |
@wiking | something similar that we do with any | 14:27 |
@wiking | namely the whole story of obtain_from_generic | 14:27 |
@wiking | imo that should be just dropped and somehow just use a similar templating mechanism that any does when you get the typed version of the thing | 14:28 |
@wiking | and there's just | 14:28 |
@wiking | i mean actually | 14:28 |
@wiking | this is something like | 14:29 |
@wiking | template<X> X get(CFeatures* f) { 'check the enum and have a nice error'; return (X)f; | 14:30 |
@wiking | } | 14:30 |
@wiking | and this could be in CFeatures | 14:30 |
@HeikoS | yes | 14:30 |
@HeikoS | yes | 14:30 |
@HeikoS | yes | 14:30 |
@HeikoS | CFeatures.as<T> | 14:30 |
@wiking | yeah better | 14:30 |
@wiking | and that does assertation | 14:30 |
@wiking | or what you want | 14:30 |
@wiking | and this pattern should be the same for | 14:31 |
@wiking | machines | 14:31 |
@wiking | btw in ensambles | 14:31 |
@wiking | the machines enumeration would make a lot of sense | 14:31 |
@wiking | if we would have some sophistication level | 14:32 |
@wiking | of ensamble methods | 14:32 |
@wiking | ;) | 14:32 |
@HeikoS | lol | 14:32 |
@HeikoS | yeah | 14:32 |
@HeikoS | ok, i like hiding away all this casting business | 14:32 |
@wiking | i can do these patches for u if u like | 14:32 |
@wiking | yes thats for sure | 14:32 |
@HeikoS | entrance task | 14:32 |
@HeikoS | replace all the old-school checks | 14:32 |
@HeikoS | lisitsyn: CMakeFiles/cpp-meta_api-kwargs.dir/meta_api/kwargs.cpp.o: In function `main': | 14:33 |
@HeikoS | /home/heiko/git/shogun/build/examples/meta/cpp/meta_api/kwargs.cpp:47: undefined reference to `void shogun::CSGObject::put<shogun::CKernel*, void>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, shogun::CKernel* const&)' | 14:33 |
@HeikoS | :( | 14:33 |
lisitsyn | HeikoS: is template still in the .h? | 14:34 |
@HeikoS | yes | 14:34 |
@wiking | btw somebody did it of course https://tinodidriksen.com/2010/04/cpp-dynamic-cast-performance/ | 14:34 |
@HeikoS | lisitsyn: shogun itself comipiles | 14:34 |
lisitsyn | HeikoS: is it template with definition? | 14:34 |
@HeikoS | (only defining SGVector<float64_t> and int32_t btw LOL) | 14:34 |
lisitsyn | HeikoS: nevermind | 14:34 |
@HeikoS | yes it is defined for SGObject | 14:34 |
lisitsyn | I think you have to drop the template | 14:35 |
lisitsyn | :) | 14:35 |
lisitsyn | otherwise it would try to instantiate that | 14:35 |
lisitsyn | and fail as it is not linked in the object file | 14:35 |
@HeikoS | yeah | 14:35 |
@HeikoS | mmmh | 14:35 |
lisitsyn | HeikoS: you've got to have only the explicit methods | 14:35 |
lisitsyn | HeikoS: you can leave the template but make it private | 14:35 |
@wiking | booooo | 14:36 |
@wiking | > z = new x.CSVM | 14:36 |
@wiking | CSVM {} | 14:36 |
@wiking | > z.cp() | 14:36 |
@wiking | [ERROR] In file /home/wiking/shogun/src/shogun/classifier/svm/SVM.cpp line 291: cannot compute objective, labels or kernel not set | 14:36 |
lisitsyn | HeikoS: I mean you have to get something like | 14:36 |
@wiking | Thrown: 6294024 - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch. | 14:36 |
@wiking | NODEJS | 14:36 |
lisitsyn | void put(string, CSGObject*); void put(string, int); blabla | 14:36 |
lisitsyn | just in the header | 14:36 |
lisitsyn | otherwise if you declare template it tries to call it | 14:36 |
lisitsyn | but fails to link | 14:36 |
@HeikoS | lisitsyn: yeah I get it | 14:36 |
@wiking | sonney2k_, ^ | 14:36 |
@HeikoS | ah pitty | 14:36 |
@HeikoS | so I will need to put all the methods back in the header | 14:37 |
lisitsyn | HeikoS: yeah one more macro for you sorry | 14:37 |
@HeikoS | was so happy that I can add without touching it | 14:37 |
lisitsyn | one is for declaration one for definition | 14:37 |
lisitsyn | sorry aobut that | 14:37 |
lisitsyn | :D | 14:37 |
@HeikoS | lisitsyn: what do you mean with make it private? | 14:38 |
@HeikoS | I just drop the template and put the explicit methods in there | 14:38 |
lisitsyn | HeikoS: yeah nevermind | 14:38 |
@HeikoS | ok compiling | 14:43 |
@wiking | lisitsyn, HeikoS just a stupid question: const char* get_name() const | 14:47 |
@wiking | can't we finally use std::string? | 14:47 |
@HeikoS | be my guest :D | 14:47 |
@wiking | no seriously | 14:47 |
@wiking | is there a blocker for this? | 14:47 |
@HeikoS | I dont think so | 14:47 |
@HeikoS | also it would be good to have a static version | 14:48 |
@wiking | ? | 14:48 |
@HeikoS | like "I expected you give me classX" | 14:48 |
@HeikoS | you can do "I expected you give me CClassX::get_name()" | 14:48 |
@HeikoS | without having an instance | 14:48 |
@HeikoS | since we have some instances of error msgs where classname changed | 14:48 |
@wiking | that should be rather easy | 14:48 |
@HeikoS | like using type names in strings is a bad idea | 14:48 |
@wiking | i mean class_list.cpp | 14:49 |
@wiking | has already all the information for what you want | 14:49 |
@HeikoS | yep | 14:49 |
@HeikoS | it is easy | 14:49 |
@HeikoS | but since ou are touching it :D | 14:49 |
@wiking | yeah no its fine | 14:49 |
@wiking | i'm just wondering is there any blockers | 14:49 |
@HeikoS | it would be good to have a type safe name thing | 14:49 |
@HeikoS | No I dont think | 14:49 |
@wiking | but afaik from the registered_parameters story | 14:49 |
@wiking | we know that | 14:49 |
@wiking | std::vector | 14:50 |
@wiking | and std::string | 14:50 |
@wiking | works everywhere | 14:50 |
@HeikoS | yes | 14:50 |
@HeikoS | well | 14:50 |
@HeikoS | we don't use that from interfaces | 14:50 |
@HeikoS | only internally | 14:50 |
@HeikoS | dont think it is tested | 14:50 |
@HeikoS | but I think std::string should be in swig | 14:50 |
@wiking | mmm | 14:50 |
@wiking | btw getname != classname :) | 14:50 |
@HeikoS | ah yes | 14:51 |
@HeikoS | somebody can pls change that? | 14:51 |
@wiking | or i mean it's rather C-prefixless name | 14:51 |
@HeikoS | although | 14:51 |
@wiking | it should be | 14:51 |
@HeikoS | we rely on the C prefix quite heavily in places | 14:51 |
@wiking | i mean for me this stuff | 14:52 |
@wiking | is getting seriously oproblematic | 14:52 |
@wiking | CSVM(float64_t C, CKernel* k, CLabels* lab); | 14:52 |
@wiking | those raw pointers | 14:52 |
@wiking | :( | 14:52 |
@HeikoS | haha | 14:52 |
@HeikoS | https://travis-ci.org/shogun-toolbox/shogun/jobs/337983286#L3284 | 14:52 |
@HeikoS | no nested kwargs :( | 14:52 |
@HeikoS | ruby doesnt like that | 14:53 |
@HeikoS | https://www.youtube.com/watch?v=HBBwXAPNLr0 | 15:05 |
@HeikoS | lisitsyn: wiking ^ | 15:05 |
@HeikoS | :D :D :D | 15:05 |
@wiking | wtf is this :D | 15:05 |
@wiking | dawgwars | 15:05 |
@HeikoS | the reason youtube exists ;) | 15:05 |
@wiking | btw | 15:06 |
@wiking | now we have two stories | 15:06 |
@wiking | now that i parsed these Features | 15:06 |
@wiking | one is the nice obtain_from_simple/obtain_from_dot | 15:07 |
@wiking | i'm not so sure why that is actually not a copyctr | 15:07 |
@wiking | template<class ST> void CDenseFeatures<ST>::obtain_from_dot(CDotFeatures* df) | 15:08 |
@wiking | https://github.com/shogun-toolbox/shogun/blob/develop/src/shogun/features/DenseFeatures.cpp#L369 | 15:08 |
@wiking | as i see this | 15:08 |
@wiking | everything gets cleared out | 15:08 |
@wiking | anyways | 15:08 |
@wiking | of course the other thing is that this (obtain_from_dot) is never used :) | 15:09 |
@wiking | obtain_from_simple is actually only tested in pytyon | 15:09 |
@wiking | realfeat=RealFeatures(CSVFile(train_fname)) | 15:09 |
@wiking | feats_train=SparseRealFeatures() | 15:09 |
@wiking | feats_train.obtain_from_simple(realfeat) | 15:09 |
@wiking | i'm not so sure why this is not a copyctor | 15:10 |
@wiking | any objections actually to move this code | 15:10 |
@wiking | to be a copyctor? | 15:10 |
@wiking | lisitsyn, HeikoS ^ | 15:10 |
@wiking | or this is for spelling out for none typed languages what to do? | 15:14 |
@wiking | and btw can we drop stuff like this | 15:16 |
@wiking | https://github.com/shogun-toolbox/shogun/blob/develop/src/shogun/features/DenseFeatures.cpp#L64 | 15:16 |
@wiking | ? | 15:16 |
@HeikoS | wiking: do it | 15:57 |
@HeikoS | copy ctor is much cleaner I think | 15:58 |
@HeikoS | keep in mind the ambiguous overloading problem in swig | 15:58 |
@HeikoS | wiking: lol duplicate | 15:58 |
@HeikoS | kill it | 15:58 |
@HeikoS | also kill all "deep_clone" | 15:58 |
@HeikoS | "shallow_clone" -> copyctor | 15:58 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4138 synchronized by syashakash | 16:12 |
@wiking | btw | 16:41 |
@wiking | anybody here | 16:41 |
@wiking | i reckon we are doing it wrong :) | 16:42 |
@wiking | se for example CPreprocessor | 16:42 |
@wiking | virtual CFeatures* apply(CFeatures* features)=0; | 16:42 |
@wiking | now as soon as we define CDensePreprocessor | 16:43 |
@wiking | shouldn't that actually in case of | 16:43 |
@wiking | virtual SGMatrix<ST> apply_to_feature_matrix(CFeatures* features)=0; | 16:43 |
@wiking | should actually apply_to_feature_matrix ask for CDenseFeatures* | 16:44 |
@wiking | namely apply_to_feature_matrix(CDenseFeatures* features) = 0; | 16:44 |
@HeikoS | wiking: yes | 17:17 |
@HeikoS | though I think that method should go | 17:17 |
@HeikoS | it should just be "apply" imo | 17:18 |
@sukey | [https://github.com/shogun-toolbox/shogun] New branch feature/obtain_from created | 17:18 |
@sukey | [https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/e7fa3c2b240bb9bf158968cb9d022723acf46564 by vigsterkr | 17:18 |
@wiking | HeikoS, that's the initial idea... it should be still refined but more or less that could be an .as for features | 17:19 |
@HeikoS | wiking: the apply_to_feature_matrix should just be an internal helper to structure things imo | 17:19 |
@HeikoS | yes exactly | 17:19 |
@wiking | the exactly is for? | 17:19 |
@HeikoS | more or less as as | 17:19 |
@wiking | ah seen the commit? | 17:19 |
@wiking | you are a quick reader | 17:19 |
@wiking | :D | 17:19 |
@HeikoS | no I only read the msg :) | 17:20 |
@HeikoS | reading commit now | 17:20 |
@wiking | k | 17:21 |
@wiking | https://github.com/shogun-toolbox/shogun/commit/e7fa3c2b240bb9bf158968cb9d022723acf46564#diff-fa6a6d0180c3b439396b402b7a82b060R290 | 17:21 |
@wiking | an example usecase | 17:21 |
@wiking | note that here we are cheating a bit | 17:21 |
@wiking | as the actual primitive type is not checked | 17:21 |
@wiking | it's doable though | 17:21 |
@wiking | and the require is not yet the one you want | 17:21 |
@wiking | imo this is a bit confusing | 17:23 |
@wiking | https://github.com/shogun-toolbox/shogun/commit/e7fa3c2b240bb9bf158968cb9d022723acf46564#diff-b6c412eeade770b369a3e1030ce2a996R54 | 17:23 |
@wiking | as you request CDenseFeatures<float64_t> but actually you get a CDenseFeatures<float64_t>* | 17:23 |
@wiking | just working on a fix | 17:23 |
@HeikoS | i think this in right direction | 17:23 |
@wiking | imo as should give you what you request | 17:24 |
@wiking | i.e. pointer or whatever u want | 17:24 |
@wiking | or we can enforce | 17:24 |
@wiking | that you have to request a pointer | 17:24 |
@wiking | as you cannot anyways have CDenseFeatures<float64_t> | 17:25 |
@HeikoS | not sure I am following? | 17:26 |
@HeikoS | mmh, isnt that too general? in practice, we always want pointer (or smart pointer) | 17:27 |
@HeikoS | just handle to the class | 17:27 |
@HeikoS | but maybe there is something better | 17:27 |
@HeikoS | sooo | 17:27 |
@wiking | i mean either way | 17:27 |
@wiking | we just need a checker | 17:27 |
@HeikoS | octave can't distinguish int and float | 17:27 |
@wiking | so that say that you give CDenseFeatures<float64_t> | 17:27 |
@wiking | then you should throw a compiler error | 17:27 |
@HeikoS | ah | 17:27 |
@wiking | as you actually can only do T* conversion | 17:27 |
@HeikoS | yeah sure | 17:28 |
@HeikoS | good stuff I like checks | 17:28 |
@wiking | so this would be a way to 'warn' the user | 17:28 |
@wiking | or the other option is | 17:28 |
@wiking | that you just provide T as the requested type | 17:28 |
@wiking | and it's implicit that you get back T* | 17:28 |
@wiking | dunno which is better | 17:28 |
@HeikoS | how would things change if we move away from raw pointers? | 17:30 |
@HeikoS | I think in that case, just having the T might be better | 17:30 |
@HeikoS | ie. implicit | 17:30 |
@wiking | mmm i mean you need to change things anyways | 17:30 |
@wiking | in the template | 17:30 |
@wiking | :) | 17:30 |
@HeikoS | sure but I mean | 17:30 |
@wiking | i mean in case .as | 17:30 |
@HeikoS | would you write | 17:30 |
@HeikoS | some<T>? | 17:31 |
@wiking | yeah that's a good question | 17:31 |
@HeikoS | so if you just write T | 17:31 |
@wiking | but essentially its the same thing | 17:31 |
@HeikoS | then at least there is no conversion from T* to some<T> | 17:31 |
@wiking | do you want the user to type out | 17:31 |
@wiking | the actual real type | 17:31 |
@wiking | or just the target class :) | 17:31 |
@wiking | without the mumbojumbo about being a smartptr/ptr | 17:31 |
@wiking | implicit should be good | 17:32 |
@HeikoS | nah I think they should just type the classname | 17:32 |
@wiking | just should warn the user | 17:32 |
@wiking | i can add a typetrait | 17:32 |
@HeikoS | kool | 17:32 |
@wiking | that that makes the compiler cry | 17:32 |
@wiking | if you do | 17:32 |
@wiking | .as<T*> | 17:32 |
@wiking | so in that case the code doesn't compile | 17:32 |
@wiking | hehe no worries | 17:33 |
@wiking | it already dies | 17:33 |
@wiking | :) | 17:33 |
@wiking | ok so i'll wait for lisitsyn to say his grace | 17:33 |
@wiking | and then i'll finish up with the stuff | 17:33 |
@wiking | and add the enum stringification in the meanwhile | 17:33 |
@wiking | HeikoS, i think we have apply_to_feature_matrix and apply_to_feature_vector because of swig, or? | 17:34 |
@wiking | but yeah that could be solved a bit differently | 17:34 |
@HeikoS | ehm | 17:34 |
@HeikoS | no idea | 17:35 |
@HeikoS | I think it was there before swig | 17:35 |
@wiking | i mean you know | 17:35 |
@wiking | or does | 17:35 |
@HeikoS | but who knows | 17:35 |
@HeikoS | I think preprocessor should just be attached to features and give you a new feature object | 17:35 |
@HeikoS | and everything is read-only :D | 17:35 |
@wiking | polymorphism work in all swig interfaces? | 17:35 |
@wiking | i'm not so sure that this flies with python | 17:36 |
@wiking | or | 17:36 |
@wiking | ? | 17:36 |
@HeikoS | Idk | 17:36 |
@wiking | pca.apply(Matrix) | 17:36 |
@wiking | pca.apply(Vector) | 17:36 |
@wiking | pca.applyVector(Vector) | 17:36 |
@wiking | as the interpreter will have no clue which one it should call | 17:36 |
@HeikoS | ah | 17:37 |
@wiking | and then it'll just throw that you have not given the right thype | 17:37 |
@HeikoS | it will just pick the first in some langs | 17:37 |
@HeikoS | same problem as I face atm | 17:37 |
@wiking | so yeah | 17:37 |
@HeikoS | only if no shared base it works | 17:37 |
@wiking | that's why you ahve to spell it out | 17:37 |
@wiking | HeikoS, shared base? | 17:37 |
@HeikoS | like | 17:37 |
@wiking | where do you have multi inheritance? :) | 17:37 |
@HeikoS | obj->method(CKernel*) | 17:38 |
@HeikoS | obj->method(CBla*) | 17:38 |
@wiking | yeah | 17:38 |
@wiking | this is why you have spelled out the method name | 17:38 |
@wiking | as the swig mapper cannot help you there | 17:38 |
@wiking | which one to call based onthe type | 17:38 |
@HeikoS | yeah, though we solved it differently in the end | 17:38 |
@wiking | as there's no type | 17:38 |
@HeikoS | we will just only have obj->method(CSGObject*) | 17:38 |
@HeikoS | and nothing else | 17:38 |
@HeikoS | no template | 17:39 |
@HeikoS | just explicit | 17:39 |
@HeikoS | but that doesnt work for you I guess | 17:39 |
@wiking | and do the hacko stuff internally? | 17:39 |
@wiking | i mean say you want | 17:39 |
@HeikoS | just register all tags CSGObject* | 17:39 |
@wiking | pca->apply() | 17:39 |
@HeikoS | yeah sure, that doesn't work for your case I think | 17:39 |
@wiking | although | 17:39 |
@HeikoS | but in the "put" case, we can do it | 17:39 |
@wiking | yeagh we dont have shared obj for SGV/M | 17:40 |
@wiking | apart from SGReferencedData | 17:40 |
@wiking | anyhow | 17:40 |
@wiking | that is ugly imo | 17:40 |
@wiking | because then in c++ case | 17:40 |
@wiking | you force this where you could still just have | 17:40 |
@wiking | pca->apply( | 17:40 |
@wiking | as the compiler in that case can take care of it | 17:40 |
@HeikoS | yes in c++ it is all different | 17:40 |
@wiking | and like other typed classes i guess it would work | 17:41 |
@wiking | like java | 17:41 |
@wiking | *typed lang | 17:41 |
@HeikoS | I think it makes sense to think about SWIG interfaces differently than the internal | 17:41 |
@wiking | yeah we always end up here | 17:41 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 synchronized by karlnapf | 17:42 |
@HeikoS | yep | 17:43 |
@HeikoS | lisitsyn: ^ | 17:43 |
@HeikoS | btw | 17:43 |
@HeikoS | lets see what travis says to that :) | 17:44 |
@HeikoS | if (has(Tag<float32_t>(name))) \ | 17:50 |
@HeikoS | put(Tag<float32_t>(name), (float32_t)value); \ | 17:50 |
@HeikoS | 8-) | 17:50 |
@HeikoS | it get's better and better | 17:50 |
-!- travis-ci [~travis-ci@ec2-54-221-64-245.compute-1.amazonaws.com] has joined #shogun | 17:52 | |
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/338082729 | 17:52 |
-!- travis-ci [~travis-ci@ec2-54-221-64-245.compute-1.amazonaws.com] has left #shogun [] | 17:52 | |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4151 merged by karlnapf | 17:56 |
@sukey | [https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/6e6cf7544059d1923bc6ece002d64b4b78dfa202 by karlnapf | 17:56 |
@HeikoS | lol | 18:05 |
@HeikoS | this swig thing | 18:05 |
@HeikoS | beast | 18:05 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 synchronized by karlnapf | 18:07 |
@HeikoS | wiking: you will love this ^ | 18:07 |
@HeikoS | lisitsyn: so octave cannot decide between int and float | 18:07 |
@wiking | yeah octave | 18:08 |
@HeikoS | https://github.com/shogun-toolbox/shogun/pull/4154/files#diff-9c3599c0d2090e493be261b079e9b63eR1030 | 18:08 |
@HeikoS | we either make the whole API ugly via putting putFloat, etc | 18:08 |
@wiking | but you need that only for octave or? | 18:08 |
@HeikoS | or we do this | 18:08 |
@HeikoS | waiting for travis | 18:08 |
@wiking | because yeah octave anyways | 18:09 |
@wiking | have a lot of ifdefs | 18:09 |
@wiking | in the swig interface files | 18:09 |
@HeikoS | mmmh | 18:09 |
@wiking | so that's ok | 18:09 |
@wiking | it is waht it is | 18:09 |
@wiking | if you want octave that's it | 18:09 |
@wiking | or we just drop it | 18:09 |
@wiking | :) | 18:09 |
@HeikoS | the code is part of libshogun | 18:09 |
@HeikoS | well i mean | 18:09 |
@HeikoS | since we copy anyways | 18:10 |
@wiking | ah i see | 18:10 |
@HeikoS | in the typemaps | 18:10 |
@wiking | i though tit's in .i | 18:10 |
@wiking | :< | 18:10 |
@HeikoS | now we do trial and error | 18:10 |
@HeikoS | yeah this is libshogun.so | 18:10 |
@wiking | mmm | 18:10 |
@wiking | yeah shitty | 18:10 |
@HeikoS | maybe that can be fixed | 18:10 |
@HeikoS | there is this "cast" in octave | 18:10 |
@wiking | but there's already these type of things | 18:10 |
@HeikoS | i mean with this solution | 18:10 |
-!- travis-ci [~travis-ci@ec2-54-221-64-245.compute-1.amazonaws.com] has joined #shogun | 18:10 | |
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/338082729 | 18:10 |
-!- travis-ci [~travis-ci@ec2-54-221-64-245.compute-1.amazonaws.com] has left #shogun [] | 18:10 | |
@HeikoS | at least it is only in the put interface method | 18:10 |
@HeikoS | not in any | 18:11 |
@wiking | https://github.com/shogun-toolbox/shogun/blob/develop/src/shogun/lib/DynamicObjectArray.h#L412 | 18:11 |
@wiking | read the comment | 18:11 |
@wiking | so yeah there are shit like this | 18:11 |
@HeikoS | hehehe | 18:11 |
@HeikoS | well | 18:11 |
@HeikoS | life | 18:11 |
@HeikoS | multi lang project | 18:11 |
@HeikoS | the number of types for put is limited | 18:11 |
@HeikoS | so the trial and error is not too bad | 18:12 |
@HeikoS | (hopefully) | 18:12 |
@wiking | man | 18:13 |
@wiking | https://www.youtube.com/watch?v=dEBQL4KPSk8 | 18:13 |
@wiking | so in other words | 18:14 |
@wiking | SGVector a(1.0, 2.0); | 18:14 |
@wiking | would work :) | 18:14 |
@HeikoS | hehe | 18:14 |
@HeikoS | no more difference, you can cast anything | 18:14 |
@HeikoS | I think there is probably lots of caveats | 18:14 |
@wiking | http://aantron.github.io/better-enums/demo/C++17ReflectionProposal.html | 18:14 |
@wiking | i came to here that | 18:14 |
@wiking | check that one out | 18:14 |
@HeikoS | cool will do | 18:15 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 synchronized by karlnapf | 18:19 |
@wiking | http://en.cppreference.com/w/cpp/algorithm/sample | 18:22 |
@wiking | ++ | 18:22 |
@HeikoS | can do proper x-validation with that :D | 18:22 |
@wiking | hehe | 18:23 |
@wiking | i mean this means => ++17 | 18:23 |
@HeikoS | fine with me | 18:24 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 | 18:27 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 | 18:27 |
-!- iglesias [503877bd@gateway/web/freenode/ip.80.56.119.189] has quit [Quit: Page closed] | 19:29 | |
-!- HeikoS [~heiko@host86-129-231-92.range86-129.btcentralplus.com] has quit [Read error: Connection reset by peer] | 19:36 | |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4138 merged by karlnapf | 19:38 |
@sukey | [https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/e01566cf825ba98dd6d45a385f4c898936464673 by karlnapf | 19:38 |
-!- HeikoS [~heiko@host86-129-231-92.range86-129.btcentralplus.com] has joined #shogun | 19:39 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 19:39 | |
@HeikoS | wiking, lisitsyn, sonney2k_ do you remember why octave has problems with float/int? | 19:41 |
@HeikoS | because the language itself can represent both | 19:41 |
@wiking | i just know about | 19:41 |
@wiking | double and double[] | 19:41 |
@HeikoS | and swig manual says that all basic types are mapped | 19:41 |
@HeikoS | ah yes | 19:42 |
@HeikoS | the matrix of size one which is a scalar | 19:42 |
@HeikoS | well that makes sense | 19:42 |
@HeikoS | octave gives swig a scalar | 19:42 |
@HeikoS | so swig calls the scalar typema?p | 19:42 |
@wiking | y | 19:42 |
@HeikoS | but for float/int | 19:42 |
@HeikoS | no understand | 19:42 |
@HeikoS | wiking: man | 19:50 |
@HeikoS | brilliant | 19:50 |
@HeikoS | wiking: so this is what octave does | 19:50 |
@HeikoS | a= 1.0 | 19:50 |
@HeikoS | guess the type of a | 19:50 |
@HeikoS | b= 1.1 | 19:50 |
@HeikoS | guess the type of b | 19:50 |
@HeikoS | lisitsyn: ^ | 19:50 |
@wiking | a = int | 19:52 |
@wiking | b float | 19:52 |
@HeikoS | hehe | 19:53 |
@HeikoS | indeed | 19:53 |
@HeikoS | so what do we do about that? | 19:53 |
@HeikoS | shall I just just 1.1 in the example? | 19:53 |
@wiking | i mean it's not stupid :P | 19:53 |
@HeikoS | or shall I put this casting magic? | 19:53 |
@wiking | it tries to use the smallest var | 19:53 |
@wiking | to represent | 19:53 |
@wiking | :) | 19:53 |
@HeikoS | 1. is a literal | 19:53 |
@HeikoS | but anyways | 19:53 |
@HeikoS | how to deal | 19:53 |
@HeikoS | ? | 19:53 |
@HeikoS | what's your opinion? | 19:53 |
@wiking | mmm | 19:53 |
@HeikoS | cast with warning? | 19:54 |
@wiking | well | 19:54 |
@HeikoS | but that only confuses people | 19:54 |
@wiking | what i would do is forget int | 19:54 |
@wiking | :D | 19:54 |
@wiking | in case of octave | 19:54 |
@wiking | can we? | 19:54 |
@HeikoS | no int allowed? | 19:54 |
@HeikoS | no | 19:54 |
@wiking | where is it needed | 19:54 |
@wiking | ? | 19:54 |
@HeikoS | I mean we can | 19:54 |
@HeikoS | but then we need to do the same trial and error conversion | 19:54 |
@HeikoS | in case we have int parameters | 19:55 |
@HeikoS | in tags | 19:55 |
@wiking | oh i see | 19:55 |
@wiking | :D | 19:55 |
@wiking | yeah its shitty | 19:55 |
@HeikoS | ok | 19:55 |
@HeikoS | the good news is | 19:55 |
@HeikoS | this will not be the case for matrices | 19:55 |
@HeikoS | hopefully at least | 19:55 |
@HeikoS | zeros(10) | 19:55 |
@HeikoS | but who knows | 19:55 |
@HeikoS | let's see what mr russia says | 19:56 |
@HeikoS | wiking: lets see wheter octave at least keeps the word length | 19:57 |
@sukey | [https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 synchronized by karlnapf | 20:08 |
@HeikoS | wiking: actually | 20:10 |
@HeikoS | I decided to also convert different word length | 20:10 |
@HeikoS | for scalars | 20:10 |
@HeikoS | e.g. | 20:10 |
@wiking | now i realised | 20:10 |
@wiking | that maybe | 20:10 |
@HeikoS | there is a 16bit integer variable registered | 20:10 |
@wiking | we can just fuck the whole system | 20:10 |
@HeikoS | and one wants to do smth like obj.put("16-bit", 2) | 20:11 |
@HeikoS | so then this works | 20:11 |
@wiking | http://en.cppreference.com/w/cpp/types/type_info | 20:11 |
@wiking | \o/ | 20:11 |
@HeikoS | you mean the tsgdatatype? | 20:12 |
@wiking | just a sec | 20:12 |
@HeikoS | ASSERT(typeid(*this) == typeid(*df)); | 20:12 |
@HeikoS | int32_t integer = 10; | 20:13 |
@HeikoS | auto any = make_any(integer); | 20:13 |
@HeikoS | EXPECT_EQ(any.type_info().hash_code(), typeid(integer).hash_code()); | 20:13 |
@wiking | yep | 20:13 |
@wiking | this is a bit concerning No other guarantees are given: type_info objects referring to different types may have the same hash_code (although the standard recommends that implementations avoid this as much as possible), and hash_code for the same type can change between invocations of the same program. | 20:13 |
@HeikoS | actually rahul used it as well | 20:13 |
@HeikoS | if (typeid(*m_linear_operator)==typeid(CDenseMatrixOperator<float64_t>)) | 20:13 |
@wiking | yes | 20:15 |
@wiking | so i mean | 20:18 |
@wiking | we could just do this | 20:18 |
@wiking | template<class T> T* as() | 20:18 |
@wiking | { | 20:18 |
@wiking | if (typeid(this) != typeid(*this)) | 20:18 |
@wiking | { | 20:18 |
@wiking | SG_SERROR("Feature is not of the requested type!\n"); | 20:18 |
@wiking | } | 20:18 |
@wiking | return (T*)this; | 20:18 |
@wiking | } | 20:18 |
@sukey | [https://github.com/shogun-toolbox/shogun] Issue https://github.com/shogun-toolbox/shogun/issues/4156 opened by kumarnitj | 20:20 |
@HeikoS | <wa | 20:25 |
@HeikoS | yes | 20:25 |
@HeikoS | print more infos, but that is good! | 20:25 |
@HeikoS | mmmmh | 20:25 |
@wiking | HeikoS, .name() | 20:30 |
@wiking | it's not tooo informative | 20:30 |
@wiking | but no enum hack then required | 20:30 |
@wiking | i mean it's not a clean string | 20:30 |
@wiking | but you it tells what is the problem | 20:31 |
@HeikoS | yep thats ok | 20:32 |
@HeikoS | just should have some notion of what is expected and what was provided | 20:32 |
@HeikoS | as provided can sometimes be unintuitive | 20:33 |
@wiking | will push something | 20:37 |
@wiking | just testing to compile | 20:37 |
@sukey | [https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/ba6b0c5deb99aaf1535664c326b12d5160aa4583 by vigsterkr | 20:40 |
@wiking | there | 20:40 |
@wiking | https://github.com/shogun-toolbox/shogun/commit/ba6b0c5deb99aaf1535664c326b12d5160aa4583#diff-7000e2136483dd4868b3ca8549281640R371 | 20:41 |
@wiking | if this is good then we can actually merge and make tons of entrance task around this | 20:44 |
@wiking | as well as for CDistance and Kernel type | 20:44 |
@wiking | i.e. whereever there's a simple explicit cast | 20:45 |
@sukey | [https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/d95dc5640678863d9cb57f256749e39a840008b7 by vigsterkr | 20:46 |
@wiking | actually we could just add .as<> and that way it would be available everywhere | 21:27 |
lisitsyn | hey | 21:34 |
lisitsyn | what's going on | 21:34 |
lisitsyn | :) | 21:34 |
-!- Ansh [~Ansh@157.41.255.229] has joined #shogun | 21:43 | |
Ansh | Hi. I was having a problem building the Shogun on Anaconda 3 on Windows. | 21:44 |
Ansh | Downloading and Extracting Packages | 21:45 |
Ansh | shogun-cpp 6.1.3: ############################################################################################# | 100% | 21:45 |
Ansh | hdf5 1.10.1: ################################################################################################## | 100% | 21:45 |
Ansh | protobuf 3.4.1: ############################################################################################### | 100% | 21:45 |
Ansh | Preparing transaction: done | 21:45 |
Ansh | Verifying transaction: done | 21:45 |
Ansh | Executing transaction: done | 21:45 |
Ansh | The batch file cannot be found. | 21:45 |
Ansh | Everything downloads as shown above. Batch file cant be found is the what it shows at the last. | 21:46 |
@wiking | lisitsyn, so | 21:53 |
@wiking | Ansh, building? | 21:53 |
@wiking | Ansh, why dont you just conda install shogun? | 21:54 |
lisitsyn | wiking: soo | 21:54 |
lisitsyn | :) | 21:54 |
@wiking | lisitsyn, what's your opinion about template<T> T* static SGObject::as() ... | 21:55 |
@wiking | ? | 21:55 |
@wiking | instead of the obtain_from | 21:55 |
@wiking | i know that doesn't solve the problem of obtain_from for swig | 21:55 |
lisitsyn | do you want to specialize it? | 21:55 |
lisitsyn | like asKernel | 21:55 |
lisitsyn | asBlabal | 21:55 |
@wiking | template<class T> T* as() | 21:56 |
@wiking | { | 21:56 |
@wiking | if (typeid(T) != typeid(*this)) | 21:56 |
@wiking | { | 21:56 |
@wiking | SG_SERROR("The object (%s) is not of the requested type %s!\n", | 21:56 |
@wiking | typeid(*this).name(), typeid(T).name()); | 21:56 |
@wiking | } | 21:56 |
@wiking | return (T*)this; | 21:56 |
@wiking | } | 21:56 |
@wiking | yeah maybe | 21:56 |
@wiking | as we rely on that sometimes | 21:56 |
@wiking | in some swig example | 21:56 |
lisitsyn | ok | 21:56 |
lisitsyn | why don't you dynamic_cast it? | 21:56 |
Ansh | Was building, following the docs. Okay tried it. But Environment not found | 21:56 |
@wiking | this is more for just throwing out the whole obtain_from | 21:56 |
lisitsyn | aha | 21:56 |
lisitsyn | ok | 21:56 |
@wiking | lisitsyn, well we could do that | 21:56 |
@wiking | i mean dyn_cast | 21:57 |
lisitsyn | this is better than obtain_from indeed | 21:57 |
@wiking | but typeid(T) != typeid(*this)) | 21:57 |
@wiking | is making sure | 21:57 |
@wiking | that it's the same type | 21:57 |
Ansh | wiking? | 21:57 |
@wiking | Ansh, which doc? | 21:58 |
Ansh | Shogun installation docs | 21:58 |
@wiking | conda install -c conda-forge shogun | 21:58 |
@wiking | this one? | 21:58 |
Ansh | yeah | 21:58 |
@wiking | and what was the error? | 21:58 |
Ansh | Preparing transaction: done | 21:59 |
Ansh | Verifying transaction: done | 21:59 |
Ansh | Executing transaction: done | 21:59 |
Ansh | The batch file cannot be found. | 21:59 |
Ansh | Last line | 21:59 |
@wiking | i dont know | 21:59 |
@wiking | you should ask conda people | 21:59 |
@wiking | the package is definitely there | 21:59 |
@wiking | https://anaconda.org/conda-forge/shogun | 21:59 |
@wiking | as u can see for linux, osx and windws | 22:00 |
@wiking | although note for conda only py35 and py36 is available | 22:00 |
@wiking | no py27 | 22:00 |
Ansh | Yeah its there. But this seems like an error for downgrade. I am on 4.4.8 and Shogun uses 4.3 something. But it automatically does downgrade | 22:01 |
Ansh | So was confused about that | 22:01 |
@wiking | lisitsyn, ok so it's a go on your end? | 22:01 |
@wiking | lisitsyn, first i only added this for CFeatures but realised it's better to add it to SGObj | 22:01 |
@wiking | as then we have it for all | 22:02 |
Ansh | Wiking, you use Shogun on Linux? Using the ppa? | 22:02 |
@wiking | Ansh, i compile myself | 22:02 |
@wiking | best is to use conda | 22:02 |
@wiking | if u have conda | 22:02 |
Ansh | Yeah thats why I was trying to do that. But failed | 22:03 |
@wiking | Ansh, no need to compile from src for u | 22:03 |
@wiking | there's plenty of binary available | 22:03 |
@wiking | ppa, conda etc | 22:03 |
Ansh | Okay I'll give it one more try on conda. If not possible then I'll see in Linux. | 22:04 |
@wiking | lisitsyn, this is gonna be shitty | 22:05 |
@wiking | doc/ipython-notebooks/clustering/GMM.ipynb: " component=Gaussian.obtain_from_generic(gmm.get_component(comp_idx))\n", | 22:05 |
@wiking | lisitsyn, as this requires asGaussian specialization in swig | 22:06 |
@wiking | :< | 22:06 |
@wiking | i mean of course it's as shitty as having those random obtain_from* methods every now and then | 22:07 |
@wiking | this way at least in the c++ interface you dont have those random functions | 22:07 |
@wiking | only in swig is randomly available | 22:07 |
-!- Ansh [~Ansh@157.41.255.229] has quit [Read error: Connection reset by peer] | 22:12 | |
-!- travis-ci [~travis-ci@ec2-54-226-47-211.compute-1.amazonaws.com] has joined #shogun | 22:26 | |
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/338168404 | 22:26 |
-!- travis-ci [~travis-ci@ec2-54-226-47-211.compute-1.amazonaws.com] has left #shogun [] | 22:26 | |
-!- travis-ci [~travis-ci@ec2-54-226-47-211.compute-1.amazonaws.com] has joined #shogun | 22:27 | |
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/338168404 | 22:27 |
-!- travis-ci [~travis-ci@ec2-54-226-47-211.compute-1.amazonaws.com] has left #shogun [] | 22:27 | |
-!- travis-ci [~travis-ci@ec2-54-159-51-80.compute-1.amazonaws.com] has joined #shogun | 23:28 | |
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/338171188 | 23:28 |
-!- travis-ci [~travis-ci@ec2-54-159-51-80.compute-1.amazonaws.com] has left #shogun [] | 23:28 | |
--- Log closed Wed Feb 07 00:00:52 2018 |
Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!