IRC logs of #shogun for Tuesday, 2018-02-06

--- 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/24601:08
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4130 merged by OXPHOS03:51
@sukey[https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/be16f3e7e388e850d0efa720cc0072eaed47d524 by OXPHOS03:51
-!- travis-ci [~travis-ci@ec2-54-159-51-80.compute-1.amazonaws.com] has joined #shogun04:24
travis-ciit'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/33784442804: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 #shogun05:02
travis-ciit'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/33784442805: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/8907:40
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4085 synchronized by vinx1307:51
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4085 synchronized by vinx1307:52
-shogun-buildbot:#shogun- Build nightly_none #89 is complete: Success [build successful] - http://buildbot.shogun-toolbox.org:8080/#builders/21/builds/8909:24
-!- HeikoS [~heiko@host86-129-231-92.range86-129.btcentralplus.com] has joined #shogun10:29
-!- mode/#shogun [+o HeikoS] by ChanServ10:29
@HeikoSlisitsyn: jo!10:48
lisitsynHeikoS: reggelt? :)10:48
@HeikoSreggelt? :D10:48
lisitsynjo reggelt!10:48
lisitsynok ok10:48
@HeikoSwhat does that mean?10:48
lisitsynsup10:48
@HeikoSsupsup10:48
@HeikoSso10:48
lisitsynHeikoS: hungary left in past10:48
lisitsyn:)10:48
@HeikoSI thought more about the api thingi10:49
lisitsynok tell me10:49
@HeikoSI think the meta grammar should not influence api decisions10:49
@HeikoSso happy to modify that10:49
@HeikoSthats thought 110:49
@HeikoSthought210:50
@HeikoSthis api is type free ... everything is runtime based10:50
@HeikoSso why enforce types in the api itself?10:50
@HeikoSno point in my eyes10:50
lisitsynyeah it is true10:50
@HeikoSI think there should be a "put", and you can give it whatever you want10:50
lisitsynuhmm10:51
lisitsynit is a bit more complex10:51
@HeikoSand then it tries to match things inside, if that doesnt work, you get an error10:51
@HeikoSfrom an API perspective that is10:51
@HeikoSput("kernel", k)10:51
lisitsynin most languages there is no 'Object' that is parent to everyone10:51
@HeikoSbut we can pass SGObject10:51
@HeikoSno?10:51
lisitsynint, float, SGVector, ..10:52
@HeikoSI mean we can have putVector etc10:52
@HeikoSbut putKernel?10:52
@HeikoSwhy not just putObject ? and then the casting/matching is done inside10:52
lisitsynok agree10:52
lisitsynso int,float,..., SGVector, SGObject*10:52
@HeikoSyeah10:53
lisitsynsounds good to me10:53
@HeikoSso how to implement that putObject thing?10:53
@HeikoSwe have it in SWIG already I think10:53
lisitsynkind of easy10:53
@HeikoSSUPPORT_TAG(Object, object, CSGObject*)10:53
lisitsynyes swig already tries to dynamic cast them10:53
@HeikoSthe only remaining q is10:53
@HeikoSwhere to implement these methods10:53
lisitsynthe only problem is that tags do not support it yet10:53
@HeikoSas if we do it in SWIG only, then the API differs from c++10:54
lisitsynbecause it tries to assign different types and then fails10:54
lisitsynno, it should be in SGOBject I believe10:54
lisitsynI like idea of having the same interface10:54
@HeikoSyeah I think I agree10:54
@HeikoSso for every primitive type that Shogun supports, there is a method in SGObject10:54
lisitsynyes10:55
@HeikoSvoid CSGObject::putKernel(const std::string& name, CKernel* value)10:55
@HeikoS{10:55
@HeikoSCSGObject::put<CSGObject*>(name, (CSGObject*)value);10:55
@HeikoS}10:55
@HeikoSand then the downcasting just happens in there10:55
lisitsynwe don't need putKernel anymore10:55
lisitsyn:)10:55
@HeikoSsorry10:55
@HeikoSmake that putObject10:55
lisitsynyeah10:55
lisitsynok10:55
@HeikoSwill swig realise that you can pass a kernel to sgobject pointer?10:55
lisitsynHeikoS: but we need to patch any10:55
lisitsyn:)10:55
@HeikoSah yeah I thought that10:55
@HeikoSok10:55
lisitsynHeikoS: swig realizes that CKernel -> CSGObject10:55
lisitsynbut10:55
lisitsyntags stuff would try to assign CSGObject to CKernel and fail10:56
lisitsynso it should try to cast back10:56
lisitsynif it worked yaya!10:56
@HeikoSis that possible?10:56
lisitsynyeah just do dynamic_cast10:56
lisitsynin case of pointers10:56
@HeikoSkk10:56
@HeikoScan you patch that?10:57
@HeikoSI will add the methods and clean up the SGBase.i10:57
@HeikoSlisitsyn: and then finally. the kwargs in the meta examples10:57
lisitsynI will check some day this week10:57
@HeikoSit needs to be typed10:57
@HeikoSthat is annoying10:57
@HeikoSbut we cannot avoid this I think10:57
lisitsynnot really10:57
lisitsynfor python you can dispatch types10:57
lisitsynwe can write simple method to do that10:57
@HeikoSok but that is fine since it is only the meta example, not the generated listing10:57
@HeikoSand in python, we can dispatch it nicely10:58
@HeikoSbut for the langs where that doesnt work, we need to translate typed10:58
@HeikoSKernelMachine svm = kernel_machine("LibSVM", Float C1=2.0, Kernel kernel=k)10:58
@HeikoSsomething like this10:58
lisitsynuh10:58
lisitsynprobably yes10:59
@HeikoSand that can be parsed and translated to both putFloat, putObject, ... and to dispatch way as in python10:59
@HeikoSI now just wonder10:59
lisitsynoh well10:59
@HeikoSis that nicer than having a new line for every parameter? :10:59
lisitsyn:)10:59
@HeikoSwhat do you think?10:59
@HeikoSis it worth the trouble?10:59
@HeikoSwhat we get from this is that we can do kwargs for dispatchable langs10:59
@HeikoSi.e. python examples will be much neater10:59
lisitsynuhmm I think it is worth it11:00
@HeikoSok11:00
lisitsynI mean we have to add types anyway11:00
@HeikoSkk11:00
lisitsynahh btw11:00
lisitsynstahp!11:00
lisitsyn:)11:00
@HeikoSstahp?11:00
lisitsyn"stop"11:00
lisitsyn:)11:00
lisitsynhaving settled11:00
lisitsynthat we only have SGObject11:00
lisitsynit is actually possible to use overloading!11:01
@HeikoSexplain plssss11:01
lisitsynput(string, int)11:01
lisitsynput(string, float)11:01
@HeikoShttp://i0.kym-cdn.com/entries/icons/original/000/011/089/stahp.jpg11:01
lisitsynput(string, Vector<int>)11:01
lisitsynput(string, SGObject*)11:01
lisitsynthey are non-ambiguous11:01
@HeikoSahaaa!11:01
lisitsynthis means we don't need types11:02
lisitsynI think it should work in all the target languages11:02
@HeikoSit doesnt yet11:02
@HeikoSbut maybe that is due to the missing dynamic_cast in any?11:02
lisitsynyes11:02
lisitsynwe just need to check if it works in all the languages11:03
lisitsynso it is overloading + runtime check for SGObjects11:03
@HeikoSyes11:03
lisitsynhybrid11:03
lisitsyn:P11:03
@HeikoSso, as said yesterday11:04
@HeikoSit works in python and java ( i think)11:04
@HeikoSbut not c++ or octave11:04
lisitsynreally?11:04
@HeikoSmmmh11:04
@HeikoSmaybe I got lost11:04
@HeikoSlet me find11:04
lisitsynI mean C++11:04
lisitsyn:)11:04
lisitsynoh well it is easy to check11:04
lisitsynlet me figure a toy example11:04
@HeikoSI have one11:04
@HeikoSIll do it11:04
@HeikoSjust a sec11:05
@wikingmuthafu11:05
@wiking]http://kripken.github.io/emscripten-site/docs/porting/connecting_cpp_and_javascript/embind.html#deriving-from-c-classes-in-javascript11:05
@wiking:)11:05
@wikingwelcome to director classes in js11:06
@HeikoSlisitsyn: so c++, java, python work11:07
@HeikoSoctave doesnt11:07
lisitsynhttps://ideone.com/YcAQHe11:07
@HeikoSah wait11:07
lisitsynHeikoS: ^ cpp sorta works11:08
lisitsyn:)11:08
@HeikoSactually11:08
@HeikoSoctave also works11:08
@HeikoSbut not for floats11:08
@HeikoSbut object works11:08
lisitsynfloat/double?11:08
lisitsynI'd expect some lang to fail with float and double11:08
@HeikoSyeah the float is issue11:08
@HeikoSyes11:08
lisitsynbut I believe we should just provide double11:08
lisitsyn:)11:08
lisitsynor float11:08
@HeikoSyep11:08
@HeikoSonly double11:08
@HeikoSeverything is copied11:08
@HeikoSso we can add expicit cast ?11:09
lisitsynI need to hack any11:09
lisitsynto support assigning float = double11:09
@HeikoSyep11:09
lisitsynand CKernel = CSGObject11:09
@HeikoSsame for int I think11:09
@HeikoSCKernel = CSGObject works11:09
lisitsyneh??11:09
lisitsynhow11:09
lisitsyn:D11:09
lisitsynah11:10
lisitsynhahah11:10
lisitsynHeikoS: we register everything as CSGObject**11:10
lisitsynthat's whhy it works11:10
lisitsynlol11:10
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4085 synchronized by vinx1311:10
lisitsynthat's in SG_ADD11:10
@HeikoSyep :D11:10
@HeikoSstatic casts everywhere11:10
@HeikoSI think it is the same motivation as we have here in fact11:10
lisitsynit is actually good11:10
lisitsynnot the same but something covariant11:11
lisitsynokok all good11:11
@HeikoSyeah11:11
lisitsynHeikoS: so we just need float=double things to make it work in octave and similar langs11:11
@HeikoSyes I think11:12
lisitsynthen we add put(string, {int,float,...})11:12
@HeikoSand what would really help is also:11:12
@HeikoSSG_ERROR("Type error when setting parameter %s::%s: expected %s but got %s.\n",11:12
@HeikoSget_name(), _tag.name().c_str(),11:12
@HeikoS"X", "Y");11:12
lisitsynyes I remember11:12
lisitsyn:)11:12
@HeikoSlisitsyn: what do you mean "we add put ... "?11:12
@HeikoSI mean the methods are there11:12
lisitsynHeikoS: explicit11:12
@HeikoSyou mean we only instantiate the template for these types?11:12
lisitsynHeikoS: which actually is super good because finally11:13
lisitsynwe can move templated code to .cpp11:13
@HeikoSyep11:13
@HeikoSI am just thinking11:13
lisitsynshould speed up compilation quite a bit11:13
@HeikoSwhy don't we do the casting in there?11:13
@HeikoSand leave any how it is?11:13
lisitsyn?11:13
lisitsynin where?11:13
@HeikoSlike add explicit template for float_t and cast to float64_t in there11:13
lisitsynah11:13
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/408511:13
lisitsynwe can11:13
@HeikoSmaybe more explicit?11:14
lisitsynbut we don't know the type of parameter11:14
lisitsynit is better11:14
@HeikoSah you mean11:14
lisitsynthis way we have to agree11:14
lisitsynwe register everything as double11:14
@HeikoSwe should always cast *any* float value to the float type of the underlying parameter?11:14
lisitsynor we register everything as float11:14
@HeikoSmmmh I wouldnt do that I think11:14
@wikinglisitsyn, fyi https://chromium.googlesource.com/external/github.com/kripken/emscripten/+/1.35.20/system/include/emscripten/bind.h#56011:14
lisitsynotherwise we don't know11:14
@HeikoSI would register is dev decises11:14
@HeikoSbut then try to convert11:14
@HeikoSso user can give anything11:15
lisitsynyeah but currently it just checks if it is the same type11:15
@HeikoSbut it is converted to the registered type11:15
lisitsynso it might be float or double11:15
lisitsynwell we can try both :D :D11:15
lisitsynor patch any to support assigning convertible types11:15
@HeikoSyeah11:15
@HeikoSI think I would do that expicitly11:15
lisitsynyes but how?11:15
@HeikoSotherwise this is lost in translation11:15
@HeikoScan't we have a real_t instantiation of put11:15
@HeikoSthat tries put<float>, put<double>, etc?11:16
lisitsynuh11:16
@HeikoSmaybe not most elegant11:16
@HeikoSwell we can patch any to accept assignment from different type then11:16
@wikingTrixis, i'll merge just lemme check the cis11:17
lisitsynHeikoS: it should be possible11:17
lisitsynlet me get back with that issue later11:17
@wikinggoing?11:17
lisitsynat least we can do it two ways11:17
@HeikoSlisitsyn: kk11:17
@wikingTrixis, how's the jni going?11:17
@HeikoSlisitsyn: ah I like this much more11:18
@HeikoSjust to have a single "put"11:18
@HeikoSlisitsyn: let me know, would be good to get this sorted soon, since then it unblocks a whole bunch of stuff I could work on11:18
-!- wuwei_ [ca781368@gateway/web/freenode/ip.202.120.19.104] has joined #shogun11:20
-!- wuwei_ [ca781368@gateway/web/freenode/ip.202.120.19.104] has quit [Client Quit]11:21
Trixiswiking: working on it, writing the java code11:26
Trixiswiking: trying to figure out where the pragmas go11:26
@wikingTrixis, mmm one thing though11:26
Trixisye?11:26
@wikinghave you seen the unofficial tf j wrapper?11:26
Trixisnope11:27
@wikingok so that is educational11:27
@wiking:)11:27
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4153 merged by vigsterkr11:29
@sukey[https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/56ae5e1c3f712fdcd7cc16f3287071b4a68c4173 by vigsterkr11:29
Trixiswiking: so the tensorflow java wrapper seems to require the jni to be passed in path?11:33
@wikingtensorflow/java/src/main/java/org/tensorflow/NativeLibrary.java11:35
@wikingand of course11: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 karlnapf11:36
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/415411:36
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/415411:36
@wiking    NativeLibrary.load();11:37
@wiking  }11:37
@wiking  static {11:37
@wiking    init();11:37
@wiking  }11:37
@wikingin classes11:37
@wikingi mean that's in main class11:37
@wiking  static {11:37
@wiking    TensorFlow.init();11:37
@wiking  }11:37
@wikingin others11:37
@wikinghttps://github.com/tensorflow/tensorflow/blob/master/tensorflow/java/src/main/java/org/tensorflow/NativeLibrary.java11:37
@wikingTrixis, https://github.com/tensorflow/tensorflow/blob/master/tensorflow/java/src/main/java/org/tensorflow/NativeLibrary.java11:37
@wikingTrixis, thi sis the typical way of loading jni from resources11:39
Trixiswiking: so yeah you extract it into temp dir11:43
Trixisand load it from there11:44
@wikingi mean you can copy paste this easy11:45
@wiking:)11:45
Trixisheh fair11:45
Trixisi 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
@wikingcool11:51
@wikingi mean if you have nicer ways that's fine11:51
@wikingbtw11:51
@wikingyou should aim 1.711:52
@wikingbut maybe even 1.811:52
@wikingas 1.7 is EOL11:52
@wikingTrixis, jdk that is11:52
@wikingHeikoS, https://github.com/shogun-toolbox/shogun/pull/4085/files#r16625552311:52
@HeikoSwiking: ++11:55
@HeikoSwiking: I remember discussing with s?ren, asking why not using dynamic_cast, and he said it was too slow ....11:55
@HeikoSbut this is the init method ... only called once anyways11:55
@HeikoSI would just do everything with exceptions11:56
@HeikoStry to use the given thing and if it doesnt work, throw exception11:56
@HeikoSproper runtime typing11:56
@wikingi disagree with the enum11:58
@wikingthey are indeed good11:58
@wikingas you can actually check without dynamic casting11:58
@wikingand assure the types11:59
@wikingindeed casting is not really waht you wanna rely on too much12:02
@wikingas it make things indeed slower12:03
@wikingthis way you can do the compatible type checking etc12:03
@HeikoSbut too many types12:04
@HeikoSwhy not make it a sring?12:04
@HeikoSstring12:04
@wikinglol?12:04
@wikingare you serious that you wanna do strcmp?12:05
@HeikoSI mean type checking doesnt happen inside algorithms12:05
@wikinglet's not make everything soooo pythonic12:05
@wikingHeikoS, well in this case it does12:05
@wikingit actually tests the types that they are compatible etc12:05
@wikingyou can enumerate over enums12:06
@wikingwhereas comparing strings is n more operations12:06
@wikingand its prone to error12:06
@wikingthis way you fix the type12:06
@HeikoSsure it is more expensive12:06
@HeikoSbut you only do that once12:06
@wikingand even the compiler does you many checks12:06
@wikingright away12:06
@wikingyeah but many12:06
@wiking*man12:06
@wikinguse the compielr12:06
@HeikoSI don't like these hundreds of enums at all12:07
@wikingthere's gonna be just errors12:07
@wikingall over12:07
@wikingif you start using strings for type description12:07
@HeikoScan use the compiler12:07
@HeikoSbut no enums12:07
@HeikoSdynamic_cast12:07
@wiking?12:07
@wikingno12:08
@wikingthat's not the same12:08
@wiking:)12:08
@HeikoSimo, the only advantage that enums have in this particular case is that compiling detects typos12:08
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4085 synchronized by vinx1312:09
@HeikoSbut otherwise, I don't see the advantage12:09
@HeikoSespecially the speed argument12:09
@wikingwhat do you mean speed argument?12:09
@HeikoSthat it is faster to check enums12:09
@wikingway faster yes12:09
@HeikoSif one does type checking inside a loop, something is wrong with the algorithm design12:09
@wikingmmmm12:09
@HeikoSso I of course wouldnt do that with strings12:10
@wikingvbut even in that case12:10
@wikingsay that its not the same speed12:10
@HeikoSwe have lots of this stuff12:10
@HeikoSREQUIRE(    lhs->get_feature_class() == C_DENSE,    "Left hand side (was %s) has to be CDenseFeatures instance.\n",    lhs->get_name());12:10
@HeikoSand I think that is not good12:10
@wikingwell if you start with a base class12:10
@HeikoSshould be done with base classes12:10
@wikingthere's not much really you can do12:11
@HeikoSyeah sure need to do the check12:11
@HeikoSbut what does the enum buy you here?12:11
@HeikoSdoing this check once?12:11
@HeikoSanyways12:11
@HeikoSnot important12:11
@wikingyou can enumerate and its fixed12:11
@wikingfor you12:11
@HeikoSbut we never do that12:11
@wiking...12:11
@wikingi mean man i dont get it12:11
@wikingwe start a discussion here12:11
@wikingabout something and you say in the middle of it12:12
@wikingthat it's not important12:12
@wikingfine12:12
@HeikoSwell ok12:12
@wikingif it's not then why do you bother to start it?12:12
@HeikoSso where do we iterate over enums?12:12
@wikingi'm sayig that a12:12
@wikingit has the advantage of switch()12:12
@wikingas well as fixes types12:13
@HeikoSit has12:13
@HeikoSbut we dont do that12:13
@wikingi.e. you can rely on typechecking12:13
@wikingof typechekcing12:13
@wikinglhs->get_feature_class() == C_DENSE12:13
@wikingthis is relying on compiler12:13
@wikingC_DENSEMYCUSTOMTYPE12:13
@wikingwill fail12:13
@wikingas soon as you do it12:13
@HeikoSsure, that's what I said above, it detects typos12:14
@wikingunless you declare that type12:14
@wikingas well as you can query the types12:14
@wikingright?12:14
@HeikoSyou can12:14
@HeikoSbut we dont dpo that12:14
@wikingyou just do it12:14
@wikingREQUIRE(     lhs->get_feature_class() == C_DENSE,     "Left hand side (was %s) has to be CDenseFeatures instance.\n",     lhs->get_name());12:14
@wikingsame for features12:14
@wikingas well as machines12:14
@wikinggit grep get_feature_class|wc -l12:15
@wiking     24312:15
@HeikoSI think one could get away with a simpler comparison in these cases12:16
@wikingHeikoS, like?12:16
@HeikoSstring :D12:16
@wikingi mean i'm not so sure12:16
@wikingwhat is simpler12:16
@wikingthan a byte12:16
@HeikoSerror messages would also be neater12:17
@HeikoSsince once can print the type12:17
@HeikoSfor enums we need to define another to_string thing12:17
@HeikoSso we have confusing error messages alover12:17
@HeikoS"expected type was 20, but needs to be DENSE"12:17
@wikingHeikoS, i think you are mixing 2 things here12:18
@wikingone is the enum12:18
@wikingand the other is how these are being checked and printed12:18
@wikingthe REQUIRED12:18
@wikingis a shitty design12:18
@wikingespecially that it's a macro12:18
@HeikoSI 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
@wikingyes12:19
@wikingit is a server cost12:19
@wikingthat you start having problems with12:19
@HeikoSand the downsides are not that bad imo12:19
@wikingcontent12:19
@wikingof strings12:19
@wiking:)12:19
@HeikoSyeah sure12:19
@HeikoStypos etc12:19
@wikingutf8 or utf1612:19
@wikingor ascii12:19
@wiking?12:19
@wikingor which string exactly12:19
@wikingyou mean here?12:19
@wikingas you know c++ does not really have a standard12:20
@wikingaround that12:20
@wikingwhich strcmp do you wanna call12:20
@HeikoSI am more talking about shogun's particular use cases12:20
@HeikoSnot general12:20
@wikingfor utf8 or utf16?12:20
@HeikoSI am not talking general about this12:20
@HeikoSbut just for Shogun12:20
@wikingyes12:20
@wikingin shogun12:20
@HeikoSfor those feature type checks12:20
@wikingif you do this12:20
@wikingwhich string you gonna be passing around12:20
@wiking?12:20
@HeikoSthe same as we use in get_name12:20
@HeikoSor a modern version of that12:20
@wikingi dont understand why is it not easier12:20
@wikingto make a template for this12:21
@wikingand make it work12:21
@wikinginstead of starting using12:21
@HeikoScan do as well12:21
@HeikoSof course12:21
@wikingutf8 strings to actually do the job12:21
@wikingi mean not understanding and using a language12:21
@wikingshould not mean that you are using12:21
@wiking3 constructs12:21
@wikingstring12:21
@wikingmap12:21
@wikinglist12:21
@wikinglike in python12:21
@wikingno offence12:21
@HeikoSwow12:22
@HeikoSI think I don't have anything more to add then12:22
@wikingi mean you wanna exchange a strictly type thing for a dynamic content12:22
@wikingto actually check a dynamic content12:23
@wikingthat's what you are proposing here12:23
@wikingsure things could be improved around REQUIRE12:23
@wikingbut that's not how you store information12:23
@wikingbut how you extract12:23
@HeikoSlisitsyn: looks like the downcasting also needs to be addressed in any: https://travis-ci.org/shogun-toolbox/shogun/jobs/337947153#L511112:30
@wikinghttps://ideone.com/PZYvG612:34
@wikingthis is the most c99 solution for you problem12:34
@wikingand you could as well just do a typecasting for std::string instead of os12:34
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 synchronized by karlnapf12:35
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4155 opened by karlnapf13:16
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 synchronized by karlnapf13:17
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/415513:18
lisitsynwhat enums are you talking about?13:39
lisitsynHeikoS: ok I now understand why you want these types in errors :)13:39
@HeikoSlisitsyn: :D13:55
@HeikoSlisitsyn: https://github.com/shogun-toolbox/shogun/pull/4154/files#diff-64897fcc9c6881619a736495fa60f9cdR3113:55
@HeikoSactually, cpp is the *only* one that doesnt work here13:55
lisitsynHeikoS: do you have the generated code somewhere?13:56
@HeikoSkernel("GaussianKernel") return CKernel* but the "kernel" is registered as CSGObject*13:56
@HeikoSsuer13:56
@HeikoSsure13:56
@HeikoSlisitsyn: https://gist.github.com/karlnapf/8f6444c40dad4010f3c0da02b2057a9313:58
@HeikoSgna13:58
@HeikoSwait13:58
lisitsynHeikoS: ah ok I get it13:58
lisitsynso we call put13:58
lisitsynit derives T=CKernel*13:58
@HeikoSupdated13:59
@HeikoSyes13:59
lisitsynokie13:59
@HeikoSI think this is solved if we make template explicit13:59
lisitsynyes13:59
@HeikoSand only allow SGObject13:59
lisitsynexactly13:59
lisitsynyes13:59
@HeikoSI am just doing that13:59
lisitsynHeikoS: try explicit13:59
@HeikoSbut since you are hacking any13:59
lisitsynI think it might have higher priority13:59
@HeikoSI think we should be consistent with where we restrict the API types13:59
lisitsynHeikoS: but not sure13:59
lisitsynHeikoS: in the interface13:59
@HeikoSeither do it in any or in explicit template13:59
lisitsynHeikoS: explicit template is better14:00
@HeikoSalso the float?14:00
lisitsynyes14:00
lisitsynall or nothing14:00
lisitsynyou have to :(14:00
lisitsynHeikoS: I can explain why :)14:00
lisitsyncompilation speed and swig14:00
@HeikoSyeah14:00
@HeikoSalso less subtle and convoluted14:01
@HeikoSlisitsyn: how do I deal with nested templates?14:03
@HeikoSI mean like SGVector<T>14:03
lisitsynHeikoS: explicit..14:03
lisitsyn:)14:03
lisitsyneverything14:03
@HeikoSjipiee!14:04
lisitsynHeikoS: yes a lot of copy paste14:04
lisitsyn*but*14:04
lisitsynit will work with swig flawlessly14:04
@HeikoSgood thing is14:04
lisitsynbecause renames didn't work at all14:04
lisitsynfor SGVector14:04
@HeikoSi have that macro in .cpp now14:04
lisitsynI stopped at the point of it no-working14:04
@HeikoSso easy to extend :D14:04
@HeikoShehe14:04
@HeikoSthe macro is still needed otherwise things dont work14:04
@HeikoSbut I will see with that later14:04
lisitsynHeikoS: swig didn't handle renames with nested templates14:04
@HeikoSah yeah I didnt get there yet14:05
@HeikoSlisitsyn: ah that is actually great14:05
@HeikoSsince we dont get explosion in names14:05
@HeikoSlisitsyn: enum above was about FT_REAL FT_SHORT FT_STRING etc14:06
@HeikoSif(get_feature_type()==FT_REAL) then bla14:06
@HeikoSlisitsyn:14:08
@HeikoStemplate <typename T, typename U = void>14:08
@HeikoSvoid put(const std::string& name, const T& value) throw(ShogunException);14:08
@HeikoSwhy the U=void in the string based put?14:08
-!- iglesias [503877bd@gateway/web/freenode/ip.80.56.119.189] has joined #shogun14:09
@wikingyou could have traits14:10
@wikingwould 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
@wikingREQUIRE(features->get_feature_class()==C_DENSE,14:12
@wiking"Provided features (%s) has to be of C_DENSE (%s) class!\n",14:12
@wikingto_string(features->get_feature_class()), to_string(C_DENSE));14:12
lisitsynHeikoS: two templated methods with the same signature14:12
lisitsynso they have additional fake template parameter14:12
@HeikoSah!14:12
@HeikoSwiking: i think either to_string or the << overloading is fine14:12
@wikingi mean the problem is that in SGIO we still use14:13
@wikingbad ass c99 snprintf14:13
@wikingand since we use strformating14:13
@wikingsee "Provided features (%s) has to be of C_DENSE (%s) class!\n",14:13
@HeikoSyep14:13
@wikingthe operator story would be a bit awkwardy14:13
@wikingdoable14:14
@wikingas one could do14:14
@wikingfor (v: varargs ) stringbuf << v; s = stringbuf.str()14:14
@wikingand since it happens at the backend you dont care14:14
@HeikoSI did this as a quick hack before https://github.com/shogun-toolbox/shogun/blob/develop/tests/unit/base/SGObjectAll_unittest.cc#L4314:14
@wikingbut as there's already string formatting14:15
@wikingi.e. you stilll wanan control the type that is being printed14:15
@wikingHeikoS, could you stop doing this14:15
@wikinghttps://github.com/shogun-toolbox/shogun/blob/develop/tests/unit/base/SGObjectAll_unittest.cc#L4814:15
@wiking?14:15
@wikingand actually just either have a mapping14:16
@wikingin TSGData14:16
@wikingtype14:16
@wikingbecause this is in a way14:16
@wikingimplemented many places14:16
@wikingin different ways14:16
@HeikoSyes14:16
@HeikoSthere is a method in SGOBject already14:16
@wikingi.e. this is why i asked14:16
@HeikoSset_generic14:16
@wikinga week ago14:16
@wikingwhat is the idea of TSGDataType14:16
@wikingas if that goes fine14:16
@wikingi dont wanna add stuff there14:16
@wikingbut if we still keep up with this14:16
@wikingthen we should just put stuff there14:17
@wikingHeikoS, your problem with nested types mostly could be solved14:17
@wikingwith the serializeable magic vararg temple14:17
@wikingHeikoS, btw feel free to add templates in unit tests14:17
@wikingin headers14:17
@wikingas that is not a big deal14:18
@wiking(no swigstuff)14:18
@wikingand plz make sure when you see a pr14:18
@wikingthat14:18
@wikinghttps://github.com/shogun-toolbox/shogun/blob/develop/tests/unit/base/SGObjectAll_unittest.cc#L814:18
@wikingis the first in includes14:18
@wikingas gtest/gmock does a lot of magic macro stuff14:18
@wikingand for exmaple they use I as a macro14:18
@wikingwhich is as well a macro obviously in <complex>14:18
@HeikoSah yes, that explains why I had problems there14:18
@HeikoSdidnt know14:18
@wikingand then it kabooom14:18
@wikingi had like couple of14:19
@wikingcommmites14:19
@wiking*commits14:19
@wikingthat moved those things around14:19
@wikingmostly lambday codes had <gtest> somewhere at the last position14:19
@HeikoSI had problems with the utils14:19
@HeikoScouldnt figure it out14:19
@HeikoSso good to know, thx14:19
@wikingnw14:22
@wikingbtw about this enum and typechecking14:22
@wikingmaybe acutally the 'gordius knot could be cut'14:22
@wikingthe easiest way is what any does14:22
@HeikoSwiking: so you think this horror should go to the datatype? https://github.com/shogun-toolbox/shogun/blob/develop/tests/unit/base/SGObjectAll_unittest.cc#L5214:22
@wikingmeaning since that init is already a bit fucked i.e. that it would be better if it gives you back the actual typed value14:22
@wikingif possible14:22
@wikingotherwise throw error14:22
@HeikoSI didnt put it because I didnt want to open that box for now, but just to add the test14:23
@wikingthen it would be better to do what any14:23
@wikingis about14:23
@HeikoSwiking: yep14:23
@HeikoSthis is my fav: https://github.com/shogun-toolbox/shogun/blob/develop/tests/unit/base/SGObjectAll_unittest.cc#L5814:23
@wikingget<ACtualType>(commonType)14:23
@wikingand then that'll as well do the typechecking14:23
@wikingand throw you a reasnable error14:23
@wikingHeikoS, i have something for L52 for you14:23
@wikingjust a secc14:24
@wikinglemme copypaste14:24
@wikingif i did a git commit14:24
@wikinghohahaha i did not but basicallhy14:24
@wikingthe idea was that you can generate a nice template map14:25
@wikingfor the these things14:25
@wikingwhat you are doing there14:25
@wikingand actually some of it you can nicely do14:25
@wikingwith typetraits14:25
@wikingfor example for EContainerType14:25
@wikingas you often would do shit like14:25
@wikingfiguring out the SGVector's EPrimitiveType and EContainerType14:26
@wikingor any particular variable14:26
@HeikoSyeah, all that should be in the datatype14:26
@wikingi can port that from the cereal branch14:27
@wikingif we really14:27
@wikingdont wanna kill14:27
@HeikoSfor both finding out and stringing ...14:27
@wikingthe shole datatype14:27
@wikingbut i would do for casting14:27
@wikingsomething similar that we do with any14:27
@wikingnamely the whole story of obtain_from_generic14:27
@wikingimo that should be just dropped and somehow just use a similar templating mechanism that any does when you get the typed version of the thing14:28
@wikingand there's just14:28
@wikingi mean actually14:28
@wikingthis is something like14:29
@wikingtemplate<X> X get(CFeatures* f) { 'check the enum and have a nice error'; return (X)f;14:30
@wiking}14:30
@wikingand this could be in CFeatures14:30
@HeikoSyes14:30
@HeikoSyes14:30
@HeikoSyes14:30
@HeikoSCFeatures.as<T>14:30
@wikingyeah better14:30
@wikingand that does assertation14:30
@wikingor what you want14:30
@wikingand this pattern should be the same for14:31
@wikingmachines14:31
@wikingbtw in ensambles14:31
@wikingthe machines enumeration would make a lot of sense14:31
@wikingif we would have some sophistication level14:32
@wikingof ensamble methods14:32
@wiking;)14:32
@HeikoSlol14:32
@HeikoSyeah14:32
@HeikoSok, i like hiding away all this casting business14:32
@wikingi can do these patches for u if u like14:32
@wikingyes thats for sure14:32
@HeikoSentrance task14:32
@HeikoSreplace all the old-school checks14:32
@HeikoSlisitsyn: 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
lisitsynHeikoS: is template still in the .h?14:34
@HeikoSyes14:34
@wikingbtw somebody did it of course https://tinodidriksen.com/2010/04/cpp-dynamic-cast-performance/14:34
@HeikoSlisitsyn: shogun itself comipiles14:34
lisitsynHeikoS: is it template with definition?14:34
@HeikoS(only defining SGVector<float64_t> and int32_t btw LOL)14:34
lisitsynHeikoS: nevermind14:34
@HeikoSyes it is defined for SGObject14:34
lisitsynI think you have to drop the template14:35
lisitsyn:)14:35
lisitsynotherwise it would try to instantiate that14:35
lisitsynand fail as it is not linked in the object file14:35
@HeikoSyeah14:35
@HeikoSmmmh14:35
lisitsynHeikoS: you've got to have only the explicit methods14:35
lisitsynHeikoS: you can leave the template but make it private14:35
@wikingbooooo14:36
@wiking> z = new x.CSVM14:36
@wikingCSVM {}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 set14:36
lisitsynHeikoS: I mean you have to get something like14:36
@wikingThrown: 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
@wikingNODEJS14:36
lisitsynvoid put(string, CSGObject*); void put(string, int); blabla14:36
lisitsynjust in the header14:36
lisitsynotherwise if you declare template it tries to call it14:36
lisitsynbut fails to link14:36
@HeikoSlisitsyn: yeah I get it14:36
@wikingsonney2k_, ^14:36
@HeikoSah pitty14:36
@HeikoSso I will need to put all the methods back in the header14:37
lisitsynHeikoS: yeah one more macro for you sorry14:37
@HeikoSwas so happy that I can add without touching it14:37
lisitsynone is for declaration one for definition14:37
lisitsynsorry aobut that14:37
lisitsyn:D14:37
@HeikoSlisitsyn: what do you mean with make it private?14:38
@HeikoSI just drop the template and put the explicit methods in there14:38
lisitsynHeikoS: yeah nevermind14:38
@HeikoSok compiling14:43
@wikinglisitsyn, HeikoS just a stupid question: const char* get_name() const14:47
@wikingcan't we finally use std::string?14:47
@HeikoSbe my guest :D14:47
@wikingno seriously14:47
@wikingis there a blocker for this?14:47
@HeikoSI dont think so14:47
@HeikoSalso it would be good to have a static version14:48
@wiking?14:48
@HeikoSlike "I expected you give me classX"14:48
@HeikoSyou can do "I expected you give me CClassX::get_name()"14:48
@HeikoSwithout having an instance14:48
@HeikoSsince we have some instances of error msgs where classname changed14:48
@wikingthat should be rather easy14:48
@HeikoSlike using type names in strings is a bad idea14:48
@wikingi mean class_list.cpp14:49
@wikinghas already all the information for what you want14:49
@HeikoSyep14:49
@HeikoSit is easy14:49
@HeikoSbut since ou are touching it :D14:49
@wikingyeah no its fine14:49
@wikingi'm just wondering is there any blockers14:49
@HeikoSit would be good to have a type safe name thing14:49
@HeikoSNo I dont think14:49
@wikingbut afaik from the registered_parameters story14:49
@wikingwe know that14:49
@wikingstd::vector14:50
@wikingand std::string14:50
@wikingworks everywhere14:50
@HeikoSyes14:50
@HeikoSwell14:50
@HeikoSwe don't use that from interfaces14:50
@HeikoSonly internally14:50
@HeikoSdont think it is tested14:50
@HeikoSbut I think std::string should be in swig14:50
@wikingmmm14:50
@wikingbtw getname != classname :)14:50
@HeikoSah yes14:51
@HeikoSsomebody can pls change that?14:51
@wikingor i mean it's rather C-prefixless name14:51
@HeikoSalthough14:51
@wikingit should be14:51
@HeikoSwe rely on the C prefix quite heavily in places14:51
@wikingi mean for me this stuff14:52
@wikingis getting seriously oproblematic14:52
@wikingCSVM(float64_t C, CKernel* k, CLabels* lab);14:52
@wikingthose raw pointers14:52
@wiking:(14:52
@HeikoShaha14:52
@HeikoShttps://travis-ci.org/shogun-toolbox/shogun/jobs/337983286#L328414:52
@HeikoSno nested kwargs :(14:52
@HeikoSruby doesnt like that14:53
@HeikoShttps://www.youtube.com/watch?v=HBBwXAPNLr015:05
@HeikoSlisitsyn: wiking ^15:05
@HeikoS:D :D :D15:05
@wikingwtf is this :D15:05
@wikingdawgwars15:05
@HeikoSthe reason youtube exists ;)15:05
@wikingbtw15:06
@wikingnow we have two stories15:06
@wikingnow that i parsed these Features15:06
@wikingone is the nice obtain_from_simple/obtain_from_dot15:07
@wikingi'm not so sure why that is actually not a copyctr15:07
@wikingtemplate<class ST> void CDenseFeatures<ST>::obtain_from_dot(CDotFeatures* df)15:08
@wikinghttps://github.com/shogun-toolbox/shogun/blob/develop/src/shogun/features/DenseFeatures.cpp#L36915:08
@wikingas i see this15:08
@wikingeverything gets cleared out15:08
@wikinganyways15:08
@wikingof course the other thing is that this (obtain_from_dot) is never used :)15:09
@wikingobtain_from_simple is actually only tested in pytyon15:09
@wiking        realfeat=RealFeatures(CSVFile(train_fname))15:09
@wiking        feats_train=SparseRealFeatures()15:09
@wiking        feats_train.obtain_from_simple(realfeat)15:09
@wikingi'm not so sure why this is not a copyctor15:10
@wikingany objections actually to move this code15:10
@wikingto be a copyctor?15:10
@wikinglisitsyn, HeikoS ^15:10
@wikingor this is for spelling out for none typed languages what to do?15:14
@wikingand btw can we drop stuff like this15:16
@wikinghttps://github.com/shogun-toolbox/shogun/blob/develop/src/shogun/features/DenseFeatures.cpp#L6415:16
@wiking?15:16
@HeikoSwiking: do it15:57
@HeikoScopy ctor is much cleaner I think15:58
@HeikoSkeep in mind the ambiguous overloading problem in swig15:58
@HeikoSwiking: lol duplicate15:58
@HeikoSkill it15:58
@HeikoSalso kill all "deep_clone"15:58
@HeikoS"shallow_clone" -> copyctor15:58
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4138 synchronized by syashakash16:12
@wikingbtw16:41
@wikinganybody here16:41
@wikingi reckon we are doing it wrong :)16:42
@wikingse for example CPreprocessor16:42
@wikingvirtual CFeatures* apply(CFeatures* features)=0;16:42
@wikingnow as soon as we define CDensePreprocessor16:43
@wikingshouldn't that actually in case of16:43
@wikingvirtual SGMatrix<ST> apply_to_feature_matrix(CFeatures* features)=0;16:43
@wikingshould actually apply_to_feature_matrix ask for CDenseFeatures*16:44
@wikingnamely apply_to_feature_matrix(CDenseFeatures* features) = 0;16:44
@HeikoSwiking: yes17:17
@HeikoSthough I think that method should go17:17
@HeikoSit should just be "apply" imo17:18
@sukey[https://github.com/shogun-toolbox/shogun] New branch feature/obtain_from created17:18
@sukey[https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/e7fa3c2b240bb9bf158968cb9d022723acf46564 by vigsterkr17:18
@wikingHeikoS, that's the initial idea... it should be still refined but more or less that could be an .as for features17:19
@HeikoSwiking: the apply_to_feature_matrix should just be an internal helper to structure things imo17:19
@HeikoSyes exactly17:19
@wikingthe exactly is for?17:19
@HeikoSmore or less as as17:19
@wikingah seen the commit?17:19
@wikingyou are a quick reader17:19
@wiking:D17:19
@HeikoSno I only read the msg :)17:20
@HeikoSreading commit now17:20
@wikingk17:21
@wikinghttps://github.com/shogun-toolbox/shogun/commit/e7fa3c2b240bb9bf158968cb9d022723acf46564#diff-fa6a6d0180c3b439396b402b7a82b060R29017:21
@wikingan example usecase17:21
@wikingnote that here we are cheating a bit17:21
@wikingas the actual primitive type is not checked17:21
@wikingit's doable though17:21
@wikingand the require is not yet the one you want17:21
@wikingimo this is a bit confusing17:23
@wikinghttps://github.com/shogun-toolbox/shogun/commit/e7fa3c2b240bb9bf158968cb9d022723acf46564#diff-b6c412eeade770b369a3e1030ce2a996R5417:23
@wikingas you request CDenseFeatures<float64_t> but actually you get a CDenseFeatures<float64_t>*17:23
@wikingjust working on a fix17:23
@HeikoSi think this in right direction17:23
@wikingimo as should give you what you request17:24
@wikingi.e. pointer or whatever u want17:24
@wikingor we can enforce17:24
@wikingthat you have to request a pointer17:24
@wikingas you cannot anyways have CDenseFeatures<float64_t>17:25
@HeikoSnot sure I am following?17:26
@HeikoSmmh, isnt that too general? in practice, we always want pointer (or smart pointer)17:27
@HeikoSjust handle to the class17:27
@HeikoSbut maybe there is something better17:27
@HeikoSsooo17:27
@wikingi mean either way17:27
@wikingwe just need a checker17:27
@HeikoSoctave can't distinguish int and float17:27
@wikingso that say that you give CDenseFeatures<float64_t>17:27
@wikingthen you should throw a compiler error17:27
@HeikoSah17:27
@wikingas you actually can only do T* conversion17:27
@HeikoSyeah sure17:28
@HeikoSgood stuff I like checks17:28
@wikingso this would be a way to 'warn' the user17:28
@wikingor the other option is17:28
@wikingthat you just provide T as the requested type17:28
@wikingand it's implicit that you get back T*17:28
@wikingdunno which is better17:28
@HeikoShow would things change if we move away from raw pointers?17:30
@HeikoSI think in that case, just having the T might be better17:30
@HeikoSie. implicit17:30
@wikingmmm i mean you need to change things anyways17:30
@wikingin the template17:30
@wiking:)17:30
@HeikoSsure but I mean17:30
@wikingi mean in case .as17:30
@HeikoSwould you write17:30
@HeikoSsome<T>?17:31
@wikingyeah that's a good question17:31
@HeikoSso if you just write T17:31
@wikingbut essentially its the same thing17:31
@HeikoSthen at least there is no conversion from T* to some<T>17:31
@wikingdo you want the user to type out17:31
@wikingthe actual real type17:31
@wikingor just the target class :)17:31
@wikingwithout the mumbojumbo about being a smartptr/ptr17:31
@wikingimplicit should be good17:32
@HeikoSnah I think they should just type the classname17:32
@wikingjust should warn the user17:32
@wikingi can add a typetrait17:32
@HeikoSkool17:32
@wikingthat that makes the compiler cry17:32
@wikingif you do17:32
@wiking.as<T*>17:32
@wikingso in that case the code doesn't compile17:32
@wikinghehe no worries17:33
@wikingit already dies17:33
@wiking:)17:33
@wikingok so i'll wait for lisitsyn to say his grace17:33
@wikingand then i'll finish up with the stuff17:33
@wikingand add the enum stringification in the meanwhile17:33
@wikingHeikoS, i think we have apply_to_feature_matrix and apply_to_feature_vector because of swig, or?17:34
@wikingbut yeah that could be solved a bit differently17:34
@HeikoSehm17:34
@HeikoSno idea17:35
@HeikoSI think it was there before swig17:35
@wikingi mean you know17:35
@wikingor does17:35
@HeikoSbut who knows17:35
@HeikoSI think preprocessor should just be attached to features and give you a new feature object17:35
@HeikoSand everything is read-only :D17:35
@wikingpolymorphism work in all swig interfaces?17:35
@wikingi'm not so sure that this flies with python17:36
@wikingor17:36
@wiking?17:36
@HeikoSIdk17:36
@wikingpca.apply(Matrix)17:36
@wikingpca.apply(Vector)17:36
@wikingpca.applyVector(Vector)17:36
@wikingas the interpreter will have no clue which one it should call17:36
@HeikoSah17:37
@wikingand then it'll just throw that you have not given the right thype17:37
@HeikoSit will just pick the first in some langs17:37
@HeikoSsame problem as I face atm17:37
@wikingso yeah17:37
@HeikoSonly if no shared base it works17:37
@wikingthat's why you ahve to spell it out17:37
@wikingHeikoS, shared base?17:37
@HeikoSlike17:37
@wikingwhere do you have multi inheritance? :)17:37
@HeikoSobj->method(CKernel*)17:38
@HeikoSobj->method(CBla*)17:38
@wikingyeah17:38
@wikingthis is why you have spelled out the method name17:38
@wikingas the swig mapper cannot help you there17:38
@wikingwhich one to call based onthe type17:38
@HeikoSyeah, though we solved it differently in the end17:38
@wikingas there's no type17:38
@HeikoSwe will just only have obj->method(CSGObject*)17:38
@HeikoSand nothing else17:38
@HeikoSno template17:39
@HeikoSjust explicit17:39
@HeikoSbut that doesnt work for you I guess17:39
@wikingand do the hacko stuff internally?17:39
@wikingi mean say you want17:39
@HeikoSjust register all tags CSGObject*17:39
@wikingpca->apply()17:39
@HeikoSyeah sure, that doesn't work for your case I think17:39
@wikingalthough17:39
@HeikoSbut in the "put" case, we can do it17:39
@wikingyeagh we dont have shared obj for SGV/M17:40
@wikingapart from SGReferencedData17:40
@wikinganyhow17:40
@wikingthat is ugly imo17:40
@wikingbecause then in c++ case17:40
@wikingyou force this where you could still just have17:40
@wikingpca->apply(17:40
@wikingas the compiler in that case can take care of it17:40
@HeikoSyes in c++ it is all different17:40
@wikingand like other typed classes i guess it would work17:41
@wikinglike java17:41
@wiking*typed lang17:41
@HeikoSI think it makes sense to think about SWIG interfaces differently than the internal17:41
@wikingyeah we always end up here17:41
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 synchronized by karlnapf17:42
@HeikoSyep17:43
@HeikoSlisitsyn: ^17:43
@HeikoSbtw17:43
@HeikoSlets see what travis says to that :)17:44
@HeikoSif (has(Tag<float32_t>(name))) \17:50
@HeikoSput(Tag<float32_t>(name), (float32_t)value); \17:50
@HeikoS8-)17:50
@HeikoSit get's better and better17:50
-!- travis-ci [~travis-ci@ec2-54-221-64-245.compute-1.amazonaws.com] has joined #shogun17:52
travis-ciit'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/33808272917: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 karlnapf17:56
@sukey[https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/6e6cf7544059d1923bc6ece002d64b4b78dfa202 by karlnapf17:56
@HeikoSlol18:05
@HeikoSthis swig thing18:05
@HeikoSbeast18:05
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 synchronized by karlnapf18:07
@HeikoSwiking: you will love this ^18:07
@HeikoSlisitsyn: so octave cannot decide between int and float18:07
@wikingyeah octave18:08
@HeikoShttps://github.com/shogun-toolbox/shogun/pull/4154/files#diff-9c3599c0d2090e493be261b079e9b63eR103018:08
@HeikoSwe either make the whole API ugly via putting putFloat, etc18:08
@wikingbut you need that only for octave or?18:08
@HeikoSor we do this18:08
@HeikoSwaiting for travis18:08
@wikingbecause yeah octave anyways18:09
@wikinghave a lot of ifdefs18:09
@wikingin the swig interface files18:09
@HeikoSmmmh18:09
@wikingso that's ok18:09
@wikingit is waht it is18:09
@wikingif you want octave that's it18:09
@wikingor we just drop it18:09
@wiking:)18:09
@HeikoSthe code is part of libshogun18:09
@HeikoSwell i mean18:09
@HeikoSsince we copy anyways18:10
@wikingah i see18:10
@HeikoSin the typemaps18:10
@wikingi though tit's in .i18:10
@wiking:<18:10
@HeikoSnow we do trial and error18:10
@HeikoSyeah this is libshogun.so18:10
@wikingmmm18:10
@wikingyeah shitty18:10
@HeikoSmaybe that can be fixed18:10
@HeikoSthere is this "cast" in octave18:10
@wikingbut there's already these type of things18:10
@HeikoSi mean with this solution18:10
-!- travis-ci [~travis-ci@ec2-54-221-64-245.compute-1.amazonaws.com] has joined #shogun18:10
travis-ciit'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/33808272918:10
-!- travis-ci [~travis-ci@ec2-54-221-64-245.compute-1.amazonaws.com] has left #shogun []18:10
@HeikoSat least it is only in the put interface method18:10
@HeikoSnot in any18:11
@wikinghttps://github.com/shogun-toolbox/shogun/blob/develop/src/shogun/lib/DynamicObjectArray.h#L41218:11
@wikingread the comment18:11
@wikingso yeah there are shit like this18:11
@HeikoShehehe18:11
@HeikoSwell18:11
@HeikoSlife18:11
@HeikoSmulti lang project18:11
@HeikoSthe number of types for put is limited18:11
@HeikoSso the trial and error is not too bad18:12
@HeikoS(hopefully)18:12
@wikingman18:13
@wikinghttps://www.youtube.com/watch?v=dEBQL4KPSk818:13
@wikingso in other words18:14
@wikingSGVector a(1.0, 2.0);18:14
@wikingwould work :)18:14
@HeikoShehe18:14
@HeikoSno more difference, you can cast anything18:14
@HeikoSI think there is probably lots of caveats18:14
@wikinghttp://aantron.github.io/better-enums/demo/C++17ReflectionProposal.html18:14
@wikingi came to here that18:14
@wikingcheck that one out18:14
@HeikoScool will do18:15
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 synchronized by karlnapf18:19
@wikinghttp://en.cppreference.com/w/cpp/algorithm/sample18:22
@wiking++18:22
@HeikoScan do proper x-validation with that :D18:22
@wikinghehe18:23
@wikingi mean this means => ++1718:23
@HeikoSfine with me18:24
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/415418:27
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/415418: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 karlnapf19:38
@sukey[https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/e01566cf825ba98dd6d45a385f4c898936464673 by karlnapf19:38
-!- HeikoS [~heiko@host86-129-231-92.range86-129.btcentralplus.com] has joined #shogun19:39
-!- mode/#shogun [+o HeikoS] by ChanServ19:39
@HeikoSwiking, lisitsyn, sonney2k_ do you remember why octave has problems with float/int?19:41
@HeikoSbecause the language itself can represent both19:41
@wikingi just know about19:41
@wikingdouble and double[]19:41
@HeikoSand swig manual says that all basic types are mapped19:41
@HeikoSah yes19:42
@HeikoSthe matrix of size one which is a scalar19:42
@HeikoSwell that makes sense19:42
@HeikoSoctave gives swig a scalar19:42
@HeikoSso swig calls the scalar typema?p19:42
@wikingy19:42
@HeikoSbut for float/int19:42
@HeikoSno understand19:42
@HeikoSwiking: man19:50
@HeikoSbrilliant19:50
@HeikoSwiking: so this is what octave does19:50
@HeikoSa= 1.019:50
@HeikoSguess the type of a19:50
@HeikoSb= 1.119:50
@HeikoSguess the type of b19:50
@HeikoSlisitsyn: ^19:50
@wikinga = int19:52
@wikingb float19:52
@HeikoShehe19:53
@HeikoSindeed19:53
@HeikoSso what do we do about that?19:53
@HeikoSshall I just just 1.1 in the example?19:53
@wikingi mean it's not stupid :P19:53
@HeikoSor shall I put this casting magic?19:53
@wikingit tries to use the smallest var19:53
@wikingto represent19:53
@wiking:)19:53
@HeikoS1. is a literal19:53
@HeikoSbut anyways19:53
@HeikoShow to deal19:53
@HeikoS?19:53
@HeikoSwhat's your opinion?19:53
@wikingmmm19:53
@HeikoScast with warning?19:54
@wikingwell19:54
@HeikoSbut that only confuses people19:54
@wikingwhat i would do is forget int19:54
@wiking:D19:54
@wikingin case of octave19:54
@wikingcan we?19:54
@HeikoSno int allowed?19:54
@HeikoSno19:54
@wikingwhere is it needed19:54
@wiking?19:54
@HeikoSI mean we can19:54
@HeikoSbut then we need to do the same trial and error conversion19:54
@HeikoSin case we have int parameters19:55
@HeikoSin tags19:55
@wikingoh i see19:55
@wiking:D19:55
@wikingyeah its shitty19:55
@HeikoSok19:55
@HeikoSthe good news is19:55
@HeikoSthis will not be the case for matrices19:55
@HeikoShopefully at least19:55
@HeikoSzeros(10)19:55
@HeikoSbut who knows19:55
@HeikoSlet's see what mr russia says19:56
@HeikoSwiking: lets see wheter octave at least keeps the word length19:57
@sukey[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4154 synchronized by karlnapf20:08
@HeikoSwiking: actually20:10
@HeikoSI decided to also convert different word length20:10
@HeikoSfor scalars20:10
@HeikoSe.g.20:10
@wikingnow i realised20:10
@wikingthat maybe20:10
@HeikoSthere is a 16bit integer variable registered20:10
@wikingwe can just fuck the whole system20:10
@HeikoSand one wants to do smth like obj.put("16-bit", 2)20:11
@HeikoSso then this works20:11
@wikinghttp://en.cppreference.com/w/cpp/types/type_info20:11
@wiking\o/20:11
@HeikoSyou mean the tsgdatatype?20:12
@wikingjust a sec20:12
@HeikoSASSERT(typeid(*this) == typeid(*df));20:12
@HeikoSint32_t integer = 10;20:13
@HeikoSauto any = make_any(integer);20:13
@HeikoSEXPECT_EQ(any.type_info().hash_code(), typeid(integer).hash_code());20:13
@wikingyep20:13
@wikingthis 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
@HeikoSactually rahul used it as well20:13
@HeikoSif (typeid(*m_linear_operator)==typeid(CDenseMatrixOperator<float64_t>))20:13
@wikingyes20:15
@wikingso i mean20:18
@wikingwe could just do this20:18
@wikingtemplate<class T> T* as()20:18
@wiking{20:18
@wikingif (typeid(this) != typeid(*this))20:18
@wiking{20:18
@wikingSG_SERROR("Feature is not of the requested type!\n");20:18
@wiking}20:18
@wikingreturn (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 kumarnitj20:20
@HeikoS<wa20:25
@HeikoSyes20:25
@HeikoSprint more infos, but that is good!20:25
@HeikoSmmmmh20:25
@wikingHeikoS, .name()20:30
@wikingit's not tooo informative20:30
@wikingbut no enum hack then required20:30
@wikingi mean it's not a clean string20:30
@wikingbut you it tells what is the problem20:31
@HeikoSyep thats ok20:32
@HeikoSjust should have some notion of what is expected and what was provided20:32
@HeikoSas provided can sometimes be unintuitive20:33
@wikingwill push something20:37
@wikingjust testing to compile20:37
@sukey[https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/ba6b0c5deb99aaf1535664c326b12d5160aa4583 by vigsterkr20:40
@wikingthere20:40
@wikinghttps://github.com/shogun-toolbox/shogun/commit/ba6b0c5deb99aaf1535664c326b12d5160aa4583#diff-7000e2136483dd4868b3ca8549281640R37120:41
@wikingif this is good then we can actually merge and make tons of entrance task around this20:44
@wikingas well as for CDistance and Kernel type20:44
@wikingi.e. whereever there's a simple explicit cast20:45
@sukey[https://github.com/shogun-toolbox/shogun] New commit https://github.com/shogun-toolbox/shogun/commit/d95dc5640678863d9cb57f256749e39a840008b7 by vigsterkr20:46
@wikingactually we could just add .as<> and that way it would be available everywhere21:27
lisitsynhey21:34
lisitsynwhat's going on21:34
lisitsyn:)21:34
-!- Ansh [~Ansh@157.41.255.229] has joined #shogun21:43
AnshHi. I was having a problem building the Shogun on Anaconda 3 on Windows.21:44
AnshDownloading and Extracting Packages21:45
Ansh shogun-cpp 6.1.3: ############################################################################################# | 100%21:45
Anshhdf5 1.10.1: ################################################################################################## | 100%21:45
Anshprotobuf 3.4.1: ############################################################################################### | 100%21:45
Ansh Preparing transaction: done21:45
AnshVerifying transaction: done21:45
Ansh Executing transaction: done21:45
Ansh The batch file cannot be found.21:45
AnshEverything downloads as shown above. Batch file cant be found is the what it shows at the last.21:46
@wikinglisitsyn, so21:53
@wikingAnsh, building?21:53
@wikingAnsh, why dont you just conda install shogun?21:54
lisitsynwiking: soo21:54
lisitsyn:)21:54
@wikinglisitsyn, what's your opinion about template<T> T* static SGObject::as() ...21:55
@wiking?21:55
@wikinginstead of the obtain_from21:55
@wikingi know that doesn't solve the problem of obtain_from for swig21:55
lisitsyndo you want to specialize it?21:55
lisitsynlike asKernel21:55
lisitsynasBlabal21:55
@wikingtemplate<class T> T* as()21:56
@wiking{21:56
@wikingif (typeid(T) != typeid(*this))21:56
@wiking{21:56
@wikingSG_SERROR("The object (%s) is not of the requested type %s!\n",21:56
@wikingtypeid(*this).name(), typeid(T).name());21:56
@wiking}21:56
@wikingreturn (T*)this;21:56
@wiking}21:56
@wikingyeah maybe21:56
@wikingas we rely on that sometimes21:56
@wikingin some swig example21:56
lisitsynok21:56
lisitsynwhy don't you dynamic_cast it?21:56
AnshWas building, following the docs. Okay tried it. But Environment not found21:56
@wikingthis is more for just throwing out the whole obtain_from21:56
lisitsynaha21:56
lisitsynok21:56
@wikinglisitsyn, well we could do that21:56
@wikingi mean dyn_cast21:57
lisitsynthis is better than obtain_from indeed21:57
@wikingbut typeid(T) != typeid(*this))21:57
@wikingis making sure21:57
@wikingthat it's the same type21:57
Anshwiking?21:57
@wikingAnsh, which doc?21:58
AnshShogun installation docs21:58
@wikingconda install -c conda-forge shogun21:58
@wikingthis one?21:58
Anshyeah21:58
@wikingand what was the error?21:58
AnshPreparing transaction: done21:59
AnshVerifying transaction: done21:59
AnshExecuting transaction: done21:59
AnshThe batch file cannot be found.21:59
AnshLast line21:59
@wikingi dont know21:59
@wikingyou should ask conda people21:59
@wikingthe package is definitely there21:59
@wikinghttps://anaconda.org/conda-forge/shogun21:59
@wikingas u can see for linux, osx and windws22:00
@wikingalthough note for conda only py35 and py36 is available22:00
@wikingno py2722:00
AnshYeah 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 downgrade22:01
AnshSo was confused about that22:01
@wikinglisitsyn, ok so it's a go on your end?22:01
@wikinglisitsyn, first i only added this for CFeatures but realised it's better to add it to SGObj22:01
@wikingas then we have it for all22:02
AnshWiking, you use Shogun on Linux? Using the ppa?22:02
@wikingAnsh, i compile myself22:02
@wikingbest is to use conda22:02
@wikingif u have conda22:02
AnshYeah thats why I was trying to do that. But failed22:03
@wikingAnsh, no need to compile from src for u22:03
@wikingthere's plenty of binary available22:03
@wikingppa, conda etc22:03
AnshOkay I'll give it one more try on conda. If not possible then I'll see in Linux.22:04
@wikinglisitsyn, this is gonna be shitty22:05
@wikingdoc/ipython-notebooks/clustering/GMM.ipynb:    "    component=Gaussian.obtain_from_generic(gmm.get_component(comp_idx))\n",22:05
@wikinglisitsyn, as this requires asGaussian specialization in swig22:06
@wiking:<22:06
@wikingi mean of course it's as shitty as having those random obtain_from* methods every now and then22:07
@wikingthis way at least in the c++ interface you dont have those random functions22:07
@wikingonly in swig is randomly available22: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 #shogun22:26
travis-ciit'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/33816840422: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 #shogun22:27
travis-ciit'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/33816840422: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 #shogun23:28
travis-ciit'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/33817118823: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!