IRC logs of #shogun for Thursday, 2018-05-10

--- Log opened Thu May 10 00:00:00 2018
-!- witness_ [uid10044@gateway/web/irccloud.com/x-rxuhfdcuqgtjhdrq] has quit [Quit: Connection closed for inactivity]04:30
-!- wuwei [wuweilinma@gateway/shell/matrix.org/x-phahltxqjopfeymw] has quit [Ping timeout: 255 seconds]10:36
-!- HeikoS [~heiko@host81-153-166-104.range81-153.btcentralplus.com] has joined #shogun11:09
-!- mode/#shogun [+o HeikoS] by ChanServ11:09
-!- wuwei [wuweilinma@gateway/shell/matrix.org/x-jvnuupozouyhoava] has joined #shogun11:35
@HeikoSlisitsyn: jo11:59
@HeikoSmore thoughts on the const?12:00
lisitsynHeikoS: hey12:00
lisitsynHeikoS: I don't like it :D12:00
@HeikoSso what I made work is12:00
@HeikoSstatic Some<const T> from_raw(const T* raw);12:00
@HeikoStemplate<class T> const T* as() const12:00
lisitsynthat's multiplying things12:00
@HeikoSand with that12:00
@HeikoSSome<const CMulticlassLabels> multiclass_labels(const CLabels* orig);12:00
@HeikoSyes, all duplicate code12:00
@HeikoSeverything that conversts things (raw pointers to some, labels into mc labels, etc) will need to have two12:01
@HeikoSlisitsyn: empty as well12:02
@HeikoSlisitsyn: so what to do?12:02
@HeikoSlisitsyn: I think if one used shared_ptr, the same problem woudl arise, no?12:03
lisitsynHeikoS: exactly12:04
lisitsynHeikoS: shared ptr on something const is seldom to see in the code12:04
@HeikoSlisitsyn: but we have const12:06
@HeikoSand we want it12:06
lisitsynHeikoS: are you sure? :)12:06
@HeikoShow do we ensure thread safety for when using shared memory?12:07
@HeikoSlike features12:07
@HeikoSindirectly via only calling const methods?12:07
lisitsynHeikoS: we might hack it actually12:07
lisitsynHeikoS: Some<T> might become locking on non-const12:08
lisitsynand plain when const12:08
lisitsynso if you call something non-const you wait12:08
@HeikoSmmmmh12:09
@HeikoSi dont know about that12:09
@HeikoSseems to be asking for trouble12:11
lisitsynHeikoS: well, we can also throw an exception12:15
lisitsynso the constness might be in the Some12:15
lisitsynsome attribute might tell if this is read-only12:15
lisitsynif it is operator const T*() works but not operator T*() etc12:16
@HeikoSlisitsyn: that sounds better12:16
lisitsynbecause otherwise you will get an explosion of types12:16
@HeikoSyes I see that12:16
@HeikoSso you wanna add a boolean to Some12:16
lisitsynit is quadratic at least12:16
lisitsynyeah readonly12:16
@HeikoSthat tells you read only12:16
@HeikoSand then you would have get and get_const?12:17
lisitsynhttps://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Copy-on-write12:17
lisitsynHeikoS: ^ check12:17
lisitsynconst T* operator->() const12:17
lisitsynT* operator->()12:17
lisitsynthat's two methods we need to implement12:17
lisitsynfirst one works always12:17
lisitsynsecond one works if not readonly12:18
lisitsynquite easy to implement actually12:18
@HeikoSand then a from_raw that takes const pointer12:18
@HeikoSand sets the boolean12:18
lisitsynHeikoS: I'd make it readonly=fallse by default12:19
lisitsynbut add a method12:19
lisitsynreadonly() that returns itself with readonly=True12:19
lisitsynthat's the most non-intrusive change I guess12:19
@HeikoSok12:19
@HeikoSnow back to the label conversion12:19
lisitsynoh no12:19
lisitsyn:D12:19
lisitsynok what about that?12:20
@HeikoSSome<CMulticlassLabels> multiclass_labels(CLabels* orig);12:20
@HeikoSSome<CMulticlassLabels> multiclass_labels(const CLabels* orig);12:20
@HeikoSso I still would have those two12:20
lisitsynyes12:20
@HeikoSfor now12:20
@HeikoSbut later12:20
@HeikoSonce we only have some12:20
@HeikoSit will just be one12:20
lisitsynwell..12:20
lisitsyn:D12:20
@HeikoSthat accepts Some<CLabels>12:20
@HeikoSas parameter12:20
lisitsynHeikoS: you can implement a wrapper class actually12:20
lisitsynthat has two ctors12:20
lisitsynT* and const T*12:21
lisitsynand sets readonly appropriately12:21
lisitsynyou just inherit the readonly when do the conversion then12:21
lisitsynMaybeConst<T>12:21
@HeikoSwrapper class for what?12:21
lisitsynHeikoS: to avoid implementing two methods12:21
@HeikoSwell the idea was that these two functions are global12:22
@HeikoSremember the discussion we had?12:22
lisitsynyes but still you can add one parameter with implicit ctor12:22
lisitsynthat captures the const12:22
lisitsynand makes it 'bool readonly' based on that12:22
@HeikoScan you be more explicit?12:22
lisitsynthis way you implement it once12:22
lisitsynSome<CMulticlassLabels> multiclass_labels(MaybeConst<CLabels> orig);12:23
lisitsynlike that12:23
lisitsynMaybeConst<T>(T* ptr) : m_ptr(ptr)12:23
lisitsynMaybeConst<T>(const T* ptr) : m_ptr(const_cast<T*>(ptr))12:23
lisitsynah first one is also m_readonly(false)12:24
@HeikoSquite a contraption12:25
@HeikoSok and this would always appear when we convert raw pointers to some12:25
@HeikoSlisitsyn: you wanna send a PR for the some and the MaybeConst?12:26
lisitsynand second one is m_readonly(true)12:26
lisitsynsee what I mean?12:26
@HeikoSyes I get it12:26
lisitsynHeikoS: yes I do want but can't promise I get enough time :P12:33
@HeikoSok ok12:33
@HeikoSlet me do it then12:33
sukey1[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4279 merged by karlnapf12:34
sukey1[https://github.com/shogun-toolbox/shogun] karlnapf pushed 2 commits:12:34
sukey1https://github.com/shogun-toolbox/shogun/commit/fbaa510f84cb6c911f00e04f93679e2576bfb0e012:34
sukey1https://github.com/shogun-toolbox/shogun/commit/507a7049435a4866cf8bb9a193bb6a21e0252e5a12:34
@HeikoSlisitsyn: actually, I'll leave this to you, ok?12:40
@HeikoSsince then I can work on other things at the same time12:40
@HeikoSwhen shall i start pestering you? :D12:41
lisitsynHeikoS: this saturday I will try to implement that12:44
@HeikoScool!13:07
-!- travis-ci [~travis-ci@ec2-23-20-242-232.compute-1.amazonaws.com] has joined #shogun13:24
travis-ciit's Heiko Strathmann'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/37721894113:24
-!- travis-ci [~travis-ci@ec2-23-20-242-232.compute-1.amazonaws.com] has left #shogun []13:24
shogitter(shubham808) HeikoS: around ?13:31
@HeikoSyes13:31
@HeikoSshogitter: whats up?13:31
shogitter(shubham808) How do I write obj->as<CBinaryLabels>() in python13:32
shogitter(shubham808) I need to remove LabelsFactory from legacy examples13:32
-!- travis-ci [~travis-ci@ec2-54-91-238-210.compute-1.amazonaws.com] has joined #shogun13:35
travis-ciit's Heiko Strathmann'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/37721894113:35
-!- travis-ci [~travis-ci@ec2-54-91-238-210.compute-1.amazonaws.com] has left #shogun []13:35
sukey1[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4280 opened by shubham80814:06
@HeikoSshogitter: you still around shubham?14:20
@HeikoSThis is not possible, we actually want to get rid of BinaryLabels in the examples14:20
@HeikoSjust Labels14:20
shogitter(shubham808) See here https://github.com/shogun-toolbox/shogun/blob/507a7049435a4866cf8bb9a193bb6a21e0252e5a/examples/undocumented/python/structure_multiclass_bmrm.py#L8414:28
@HeikoSok, so14:30
@HeikoSyou would change14:30
@HeikoSp3bmrm_out = LabelsFactory.to_multiclass_structured(sosvm.apply())14:30
@HeikoSto14:30
@HeikoSp3bmrm_out = sosvm.apply()14:30
shogitter(shubham808) I see14:30
@HeikoSbut then14:30
@HeikoSthe variable is of type CLabels*14:30
@HeikoSso you cannot call the methods that are used in the example14:31
@HeikoSlike14:31
@HeikoSp3bmrm_out.get_num_labels()14:31
@HeikoSor p3bmrm_out.get_label(i)14:31
@HeikoSso then you will need to do this via accessing the registered parameters14:32
@HeikoSso lets see14:32
@HeikoSp3bmrm_out.get_num_labels() is fine14:33
shogitter(shubham808) Okay14:33
@HeikoSas that is a virtual method of CLabels14:33
@HeikoSyou it can stay14:33
@HeikoSthis line here is more tricky14:33
@HeikoSyi_pred = RealNumber.obtain_from_generic(p3bmrm_out.get_label(i))14:33
shogitter(shubham808) I will try it out14:35
@HeikoShttps://github.com/shogun-toolbox/shogun/blob/develop/src/shogun/structure/MulticlassSOLabels.h#L13914:36
@HeikoShttps://github.com/shogun-toolbox/shogun/blob/develop/src/shogun/structure/MulticlassSOLabels.cpp#L10414:36
@HeikoSwait14:36
@HeikoShttps://github.com/shogun-toolbox/shogun/blob/develop/src/shogun/structure/MulticlassSOLabels.cpp#L4714:36
@HeikoSso in the last link, you see the method get_label14:36
@HeikoSand it creates the CStructuredData on the fly14:37
-!- iglesiasg [~iglesias@f119189.upc-f.chello.nl] has joined #shogun14:37
shogitter(shubham808) yeah it directly casts it14:38
@HeikoSthat is a problem14:38
@HeikoSbut if we look further14:38
@HeikoSm_labels_vector[idx]14:38
@HeikoSit is just that14:38
@HeikoSso I think14:38
@HeikoSIf you register m_labels_vector14:38
@HeikoSas a parameter14:38
@HeikoSthen you can access it with14:39
@HeikoSp3bmrm_out.get_real_vector("labels_vector")14:39
@HeikoSand then the example should work14:39
@HeikoSshall I patch that, or do you understand what I  mean?14:40
shogitter(shubham808) I kinda see what you mean14:41
shogitter(shubham808) ... i will try it out and if it doesnt work i will ping u14:41
shogitter(shubham808) oh wait my other pr seems destroyed by travis14:42
iglesiasgHeikoS, hey mate14:43
@HeikoSjojo14:43
shogitter(shubham808) i will work on that first u can take this one14:43
iglesiasgHeikoS, I read the Stan example Elfarouk put up14:44
iglesiasgHeikoS, so adj() in Stan is used to get derivatives of a function wrt to some variable14:45
@HeikoSyep14:45
@HeikoSI was actyually earlier today trying to implement a kernel using that14:45
iglesiasgI was wondering if there is some relation between the adjoint of a matrix and that14:45
@HeikoSbut it is tricky14:45
@HeikoSidk14:45
@HeikoSwondered the same14:46
@HeikoSbut checked the manual14:46
@HeikoSand they say that is the method you use to get the grads14:46
iglesiasgso implementing a kernel in Stain :) - what kernel were you going for?14:47
iglesiasgStan lol14:47
@HeikoSgaussian14:48
@HeikoSfirst question I have is14:48
@HeikoShow can I wrap an existing block of memory using stan14:48
@HeikoSlike the feature vector14:48
iglesiasgI understand, yeah14:49
@HeikoSnext, more fundamental, question: if we want to stick to the features api but use stan14:50
@HeikoSthen I cannot just get/wrap the feature vectors14:50
@HeikoSbut I need like a StanDotIter14:50
iglesiasgso this would be in the sense of not only using Stan from Shogun14:51
iglesiasgbut in a way wrapping Stan so that it can be used via Shogun, or?14:51
iglesiasgwith using Stan from Shogun I meant something along the lines to that example from the PR14:52
@HeikoSah yes14:52
@HeikoSthat is easy14:52
@HeikoSthe example does it14:52
@HeikoSbut question is, can we use this nicely to say make our kernel diffable14:52
iglesiasgI think I see14:53
iglesiasgbut I guess the kernels should then be defined ?analytically?14:53
iglesiasgand probably using this data type that Stan uses for that (var?)14:53
@HeikoSyes14:54
@HeikoSthere would be some helper in the kernel14:54
@HeikoSthat generates the stan expression14:54
@HeikoSand then calling the kernel method evaluates it14:54
@HeikoSand calling the gradient method evaluates it as well14:54
iglesiasggot it14:54
@HeikoSbut I think for that we need to wrap feature dot iterators in stan14:54
@HeikoSor I mean first step could be14:55
@HeikoSto just get the feature vector14:55
@HeikoSwrap it in stan14:55
@HeikoSand then go ahead14:55
iglesiasghold on14:55
iglesiasgso feature vector is already just numbers, no?14:55
@HeikoSyes14:55
@HeikoSbut that is ok14:56
iglesiasgI see a bit the direction, it could be fancy yeah15:00
iglesiasgnow I was wondering, naive question, what can we do with the derivatives of a kernel?15:01
iglesiasgcan we use them to select kernel parameters for instance?15:01
iglesiasgfor example, the gaussian kernel analytically would be defined in terms of feature vectors (`var`s) and the width (standard deviation-ish)15:03
@HeikoStwo things15:03
iglesiasgthen we could take the derivatives wrt to the width15:03
@HeikoSone is to learn the width15:03
iglesiasggo ahead please :)15:03
iglesiasgyep15:03
@HeikoSe.g. in a GP we have the marginal likelihood15:04
@HeikoSand we want to maximise that wrt to the kernel hyperparameters15:04
@HeikoSso we take gradient steps wrt to width15:04
iglesiasgyes15:04
iglesiasgthis one is understood15:04
@HeikoSthe other situation is derivative wrt to the inputs15:04
@HeikoSk(x,y), i.e. the derivative wrt x,y15:04
@HeikoSthis can be used for kernel machines that are defined in terms of a basis that is different from the data15:05
@HeikoSlike sparse GPs15:05
@HeikoSthere we want to learn the best location of the inducing points15:05
iglesiasgI see15:05
@HeikoSfor that we need to take gradient steps once again15:05
iglesiasgin a way that would be something like learning the linear transformation from the space of the data to the space of that basis15:06
iglesiasgsort-of-ish, maybe15:06
iglesiasgmaybe not necessarily linear15:06
@HeikoSnono15:07
@HeikoSit is simpler15:07
@HeikoSjust think in terms of basis set15:07
@HeikoSyou have a set of basis functions at m locations in the space15:07
@HeikoSand you use those to explain a function that agrees with your training data15:08
@HeikoSbut training data is different from basis locations15:08
@HeikoSusually in kernel and GPs, the training data itself is the location of the basis15:08
@HeikoSbut doesnt need to be15:08
iglesiasgI think I understand, it sounds interesting15:08
iglesiasgthanks for explaining :)15:09
@HeikoSwhat are you up to?15:10
@HeikoSlisitsyn: jojo\15:10
iglesiasgstaring at ?Blind Deconvolution Meets Blind Demixing: Algorithms and Performance Bounds?15:10
@HeikoSoperator const T*() const;15:10
@HeikoST* operator->() const;15:10
@HeikoSlisitsyn: conflicts15:10
iglesiasgtrying to make some sense of it :/15:10
lisitsynyes?15:10
@HeikoSiglesiasg: sounds complicated15:11
lisitsynHeikoS: second one should not be const15:11
lisitsynT* operator->() >>const<<;15:11
iglesiasgHeikoS, not more than anyting else probably :P15:11
@HeikoSlisitsyn: thx15:11
@HeikoSlisitsyn: you ok with this:15:13
@HeikoSstatic Some<T> c_from_raw(const T* raw);15:13
@HeikoSiglesiasg: hehe15:14
lisitsynHeikoS: from_rawc15:14
lisitsyn:)15:14
lisitsynwhy not the same name?15:14
lisitsynit should overload properly, no?15:15
@HeikoSit is ambiguous no?15:17
iglesiasgHeikoS, it can be good because it is *15:23
@HeikoSok thx15:24
iglesiasgwhat is the stl equivalent to this one btw?15:26
sukey1[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4277 merged by karlnapf15:26
sukey1[https://github.com/shogun-toolbox/shogun] karlnapf pushed 2 commits:15:26
sukey1https://github.com/shogun-toolbox/shogun/commit/0e603b45765a76ecdc98db1011bcf43abc0876c315:26
sukey1https://github.com/shogun-toolbox/shogun/commit/bf67562de107044ebd110122c027a280af80274515:26
lisitsynnot sure15:28
iglesiasglisitsyn, yeah, me neither15:28
iglesiasgmaybe reset is the most similar15:29
iglesiasgoh easy! The constructor taking Y* itself15:35
@HeikoSiglesiasg: so what we are doing here15:42
@HeikoSis to make Some have a flag for const15:42
iglesiasgwhat is a flag for const? :)15:46
@HeikoSbool flag readonly15:47
iglesiasgSome<const T>?15:47
@HeikoSyeah that is the other option15:48
@HeikoSbut then there are many more types15:48
@HeikoSsee log15:48
-!- travis-ci [~travis-ci@ec2-23-23-0-116.compute-1.amazonaws.com] has joined #shogun16:17
travis-ciit's Heiko Strathmann'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/37727834416:17
-!- travis-ci [~travis-ci@ec2-23-23-0-116.compute-1.amazonaws.com] has left #shogun []16:17
-!- travis-ci [~travis-ci@ec2-54-91-238-210.compute-1.amazonaws.com] has joined #shogun16:42
travis-ciit's Heiko Strathmann'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/37727834416:42
-!- travis-ci [~travis-ci@ec2-54-91-238-210.compute-1.amazonaws.com] has left #shogun []16:42
-!- iglesiasg [~iglesias@f119189.upc-f.chello.nl] has quit [Ping timeout: 240 seconds]16:46
-!- iglesiasg [~iglesias@f119189.upc-f.chello.nl] has joined #shogun16:49
-!- iglesiasg [~iglesias@f119189.upc-f.chello.nl] has quit [Ping timeout: 256 seconds]16:54
-!- VeronicaX11 [~eriekeber@wlan-4-24.unl.edu] has joined #shogun19:08
-!- VeronicaX11 [~eriekeber@wlan-4-24.unl.edu] has left #shogun []19:16
-!- VeronicaX11 [~eriekeber@wlan-4-24.unl.edu] has joined #shogun19:17
-!- VeronicaX11 [~eriekeber@wlan-4-24.unl.edu] has left #shogun []19:18
-!- VeronicaX11 [~eriekeber@wlan-4-24.unl.edu] has joined #shogun19:35
-!- shubham808 [dfb0b06c@gateway/web/freenode/ip.223.176.176.108] has joined #shogun20:02
-!- HeikoS [~heiko@host81-153-166-104.range81-153.btcentralplus.com] has quit [Ping timeout: 260 seconds]20:30
-!- Chris____ [8602a493@gateway/web/freenode/ip.134.2.164.147] has joined #shogun21:19
Chris____Hi, is there documentation for nested cross validation using shogun?21:27
-!- shubham808 [dfb0b06c@gateway/web/freenode/ip.223.176.176.108] has quit [Ping timeout: 260 seconds]21:43
sukey1[https://github.com/shogun-toolbox/shogun] Pull Request https://github.com/shogun-toolbox/shogun/pull/4280 synchronized by shubham80822:24
-!- travis-ci [~travis-ci@ec2-54-160-138-195.compute-1.amazonaws.com] has joined #shogun23:11
travis-ciit's Shubham Shukla's turn to pay the next round of drinks for the massacre he caused in shubham808/shogun: https://travis-ci.org/shubham808/shogun/builds/37744188623:11
-!- travis-ci [~travis-ci@ec2-54-160-138-195.compute-1.amazonaws.com] has left #shogun []23:11
-!- travis-ci [~travis-ci@ec2-54-224-238-97.compute-1.amazonaws.com] has joined #shogun23:31
travis-ciit's Shubham Shukla's turn to pay the next round of drinks for the massacre he caused in shubham808/shogun: https://travis-ci.org/shubham808/shogun/builds/37744188623:31
-!- travis-ci [~travis-ci@ec2-54-224-238-97.compute-1.amazonaws.com] has left #shogun []23:31
--- Log closed Fri May 11 00:00:01 2018

Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!