Open in new window / Try shogun cloud
--- Log opened Wed Aug 02 00:00:21 2017
-!- https_GK1wmSU [~d33p-b00k@77.234.41.151] has joined #shogun05:06
-!- https_GK1wmSU [~d33p-b00k@77.234.41.151] has left #shogun []05:06
@wikingmicmn, here?08:30
micmnwiking: here09:08
-!- olinguyen [81615ad9@gateway/web/freenode/ip.129.97.90.217] has quit [Quit: Page closed]09:34
@wikingmicmn, i wrote an email to u10:22
@wikinglemme know if you wanna have some ideas reviewd10:22
micmnwiking: ok thx, so the starting should be features interface?10:24
@wikingyes10:24
micmn*starting point10:24
@wikingi mean either that10:24
@wikingor look into xval10:24
@wiking)10:24
@wikingor do both10:24
@wikingmeaning going from xval lay out the requriements10:25
@wikingwhat woudl be good to have in features10:25
@wikingand then design from there a Features interface10:25
@wikingif you see what i mean10:26
micmnyep10:27
micmnthe subset mechanism should be dropped?10:27
micmnusing views instead?10:27
@wikingwell i mean it's just a different name, right?? :)10:29
@wikingi mean the functionality would good to have10:29
@wikingthat subset does now10:29
@wikingbut the biggest problem of subset now is that you can only use one subset at a time10:29
@wikingwe would need a subset that allows you to have multiple subset at the same time10:30
micmnyeah10:31
@wikingi mean that's the 'only' shitty part from the point of Features in case of xval10:32
@wikingthat you cannot have multiple views of a given Features10:32
@wikingthat is threadsafe :P10:32
@wikingif we could first fix this with Features10:32
micmnnot sure how to do it10:32
@wikingthat would be amazing10:33
@wikingbecause now what we do is10:33
@wikingfeatures.clone()10:33
@wikingwhich is a deep copy10:33
micmnmmm so10:33
micmninstead of an "active" subset10:33
micmnwe could keep a vector of subsets10:34
@wikingyeah10:34
@wikingmaybe10:34
@wikingthe question is how to do this10:34
@wikingi mean ideally what you wanna have is to have sort of a 'view' on features10:35
@wikingthat is CoW10:35
@wikingand you get an iterator10:35
@wikingfor the view10:35
@wikingFeatures.view(SGVector<index>)10:36
@wikingthat gives you a Features10:36
@wikingbut if say Features has an iterator interface10:36
@wikingthen what you could do is10:36
@wikingthat you use a sort of Predicate to filter the iterator elements :P10:36
@wikingit wouldn't let you random access10:36
@wikingbut would work :)10:37
@wikingbecause you could just filter the original Feature iterators return values10:37
@wikingand skip the elements you are not interested in10:37
@wikingsee what i mean?10:37
micmnyeah10:37
@wikingthese are just ideas10:37
@wikingi'm not so sure which is the best idea to go with10:37
micmnthe CoW mechanism would be: until read so good, first write copy the features10:40
micmnI mean cow would apply only to views10:41
@wikingyes10:41
@wikingit's a shit of course10:41
@wikingwhen you for example have 5 views on the Features10:42
@wikingand suddenly you centralise the original features10:42
@wiking:))10:42
@wikingthen you'll have 5 copies of the same thing right?10:42
micmn:)10:42
@wikingof course ideally10:42
@wikingyou just copy the elements that you are interested in10:42
@wikingas it's a view10:43
@wikingnot the deep copy of that10:43
@wikingright?10:43
micmnyeah10:43
@wikingi mean this is what would allow us to do10:43
@wikingparallel xval10:43
@wikingw/o wasting too much memory10:44
@wikingi.e. no clone() :)10:44
@wikingand in general10:44
@wikinghaving an iterator interface for Features would be great to have10:45
@wikingas currently we always do10:48
micmnmmm actually what we iterate on? i mean there isn't a concept of 'Feature' right? indices?10:49
@wikingfor (index_t i =0 ; i < num_features(); ++i)10:49
@wiking...10:49
@wikingFeature = SGVector<T> in case of DenseFeatures10:49
@wikinghttp://shogun.ml/api/latest/classshogun_1_1CFeatures.html#a91f8bf82dad4bb05accdc606d85a0da310:50
@wikinggives you the num vectors10:50
@wikingand then you have http://shogun.ml/api/latest/singletonshogun_1_1CSparseFeatures.html#aef6eae81a9bc8c951de5493fe53adcdf10:51
@wikinghttp://shogun.ml/api/latest/singletonshogun_1_1CDenseFeatures.html#a21e2db18e15e281b91e4ba6cabe747e910:51
@wikingetc10:52
@wikingbut yeah10:52
@wikingwe dont have a generic Feature concept10:52
micmnok but say we iterate on SGVector and I write it -> how do I copy the whole subset?10:54
micmnwe could have readonly iterators and rw iterators that clone the view but dunno...10:55
-!- HeikoS [~heiko@host-92-0-169-11.as43234.net] has joined #shogun11:36
-!- mode/#shogun [+o HeikoS] by ChanServ11:36
-!- HeikoS [~heiko@host-92-0-169-11.as43234.net] has quit [Quit: Leaving.]12:20
-!- HeikoS [~heiko@host-92-0-169-11.as43234.net] has joined #shogun12:27
-!- mode/#shogun [+o HeikoS] by ChanServ12:27
@wikingmicmn, yeah i mean if you do iterators13:24
@wikingit's worth to follow the usual13:24
@wikingbegin() cbegin() end() cend() kind of logic that c++11 has13:24
micmnwiking: so we were saying, Features.view(indices) returns a Features obj, but how does it work under the hood? idea: we add a bool is_view to Features and we have two logics similar to the current m_subset_stack->has_subsets() logic, but on a write operation we copy the features13:57
-!- iglesiasg [~iglesiasg@217.119.234.214] has joined #shogun13:57
-!- mode/#shogun [+o iglesiasg] by ChanServ13:58
@wikingmmm yeah14:01
@wikingquestion is how to deal with the case when the parent is being written to?14:02
@wikingin case of the original Features...14:02
@wikingbecause in that case you would need to initiate a copy as well or?14:02
micmngood point14:03
@wikingmicmn, this is a good article about how shitty it can be to use CoW multithreaded: http://www.drdobbs.com/cpp/c-string-performance/18440545314:12
micmnthx14:14
@wikingmicmn, http://www.gotw.ca/publications/optimizations.htm14:15
@wikingmore interesting thigns14:15
@wikingabout how to do COW14:16
@wikingand some benchmarks14:16
@wikingand this is good as well14:17
@wikinghttp://www.gotw.ca/gotw/045.htm14:17
@wikingmicmn, this is a quick review https://blogs.msmvps.com/gdicanio/2016/07/09/is-copy-on-write-really-a-pessimization-under-multithreading/14:18
@wikingmicmn, as you can see folly's string replacement has cow implementation14:20
@wikingi mean using this approach most of this is ready for you :)14:24
@wikingalthough we are using refCounting for different purposes14:24
micmnwiking: so you would use a refcounter for features -> copy everytime refcount > 1 i.e. original features too14:31
micmnbut the current sgobject counter?14:32
-!- HeikoS [~heiko@host-92-0-169-11.as43234.net] has quit [Quit: Leaving.]14:37
@wikingwell that's the thing14:41
@wikingwith the current sgobject counter14:41
@wikingwe cannot do this14:41
@wikingright?14:41
@wikingor i mean you can do it14:42
@wikingbut quite in a tricky way14:42
@wikingof course nothing says you cannot reuse the refcounter class14:44
@wikingand use that separately14:44
micmnthat it's already thread safe no?14:44
@wikingthe refcounter in shogun14:45
@wikingyes14:45
@wikingit is14:45
@wikingusing atomic14:45
-!- HeikoS [~heiko@host-92-0-169-11.as43234.net] has joined #shogun16:47
-!- mode/#shogun [+o HeikoS] by ChanServ16:47
-!- iglesiasg [~iglesiasg@217.119.234.214] has quit [Quit: leaving]17:13
@wikingmicmn, you wanna have some drafts going on in a gist?17:28
micmnwiking: yeah I'm doing some experiments to see how it could work and I'll share a gist (or if you wanna do a general design gist...)17:34
@wikingnono it's fine17:39
@wikingjust wondering how you wanna do it17:39
@wikingbtw once you have the gist could you share it with HeikoS as well plz17:39
@HeikoSyep!17:40
micmnsure!17:42
@wikingthnx17:43
-!- OXPHOS [92bd305b@gateway/web/freenode/ip.146.189.48.91] has quit [Ping timeout: 260 seconds]18:06
-!- OXPHOS [92bd305b@gateway/web/freenode/ip.146.189.48.91] has joined #shogun18:37
-!- HeikoS [~heiko@host-92-0-169-11.as43234.net] has quit [Quit: Leaving.]18:54
-!- HeikoS [~heiko@host-92-0-169-11.as43234.net] has joined #shogun19:09
-!- mode/#shogun [+o HeikoS] by ChanServ19:09
-!- HeikoS [~heiko@host-92-0-169-11.as43234.net] has quit [Ping timeout: 240 seconds]19:14
@wikingbtw https://arxiv.org/pdf/1611.09957.pdf19:59
@wikinglisitsyn, ^20:01
-!- olinguyen [81615ad9@gateway/web/freenode/ip.129.97.90.217] has joined #shogun20:40
--- Log closed Thu Aug 03 00:00:22 2017