--- Log opened Wed Aug 02 00:00:21 2017 | ||
-!- https_GK1wmSU [~d33p-b00k@77.234.41.151] has joined #shogun | 05:06 | |
-!- https_GK1wmSU [~d33p-b00k@77.234.41.151] has left #shogun [] | 05:06 | |
@wiking | micmn, here? | 08:30 |
---|---|---|
micmn | wiking: here | 09:08 |
-!- olinguyen [81615ad9@gateway/web/freenode/ip.129.97.90.217] has quit [Quit: Page closed] | 09:34 | |
@wiking | micmn, i wrote an email to u | 10:22 |
@wiking | lemme know if you wanna have some ideas reviewd | 10:22 |
micmn | wiking: ok thx, so the starting should be features interface? | 10:24 |
@wiking | yes | 10:24 |
micmn | *starting point | 10:24 |
@wiking | i mean either that | 10:24 |
@wiking | or look into xval | 10:24 |
@wiking | ) | 10:24 |
@wiking | or do both | 10:24 |
@wiking | meaning going from xval lay out the requriements | 10:25 |
@wiking | what woudl be good to have in features | 10:25 |
@wiking | and then design from there a Features interface | 10:25 |
@wiking | if you see what i mean | 10:26 |
micmn | yep | 10:27 |
micmn | the subset mechanism should be dropped? | 10:27 |
micmn | using views instead? | 10:27 |
@wiking | well i mean it's just a different name, right?? :) | 10:29 |
@wiking | i mean the functionality would good to have | 10:29 |
@wiking | that subset does now | 10:29 |
@wiking | but the biggest problem of subset now is that you can only use one subset at a time | 10:29 |
@wiking | we would need a subset that allows you to have multiple subset at the same time | 10:30 |
micmn | yeah | 10:31 |
@wiking | i mean that's the 'only' shitty part from the point of Features in case of xval | 10:32 |
@wiking | that you cannot have multiple views of a given Features | 10:32 |
@wiking | that is threadsafe :P | 10:32 |
@wiking | if we could first fix this with Features | 10:32 |
micmn | not sure how to do it | 10:32 |
@wiking | that would be amazing | 10:33 |
@wiking | because now what we do is | 10:33 |
@wiking | features.clone() | 10:33 |
@wiking | which is a deep copy | 10:33 |
micmn | mmm so | 10:33 |
micmn | instead of an "active" subset | 10:33 |
micmn | we could keep a vector of subsets | 10:34 |
@wiking | yeah | 10:34 |
@wiking | maybe | 10:34 |
@wiking | the question is how to do this | 10:34 |
@wiking | i mean ideally what you wanna have is to have sort of a 'view' on features | 10:35 |
@wiking | that is CoW | 10:35 |
@wiking | and you get an iterator | 10:35 |
@wiking | for the view | 10:35 |
@wiking | Features.view(SGVector<index>) | 10:36 |
@wiking | that gives you a Features | 10:36 |
@wiking | but if say Features has an iterator interface | 10:36 |
@wiking | then what you could do is | 10:36 |
@wiking | that you use a sort of Predicate to filter the iterator elements :P | 10:36 |
@wiking | it wouldn't let you random access | 10:36 |
@wiking | but would work :) | 10:37 |
@wiking | because you could just filter the original Feature iterators return values | 10:37 |
@wiking | and skip the elements you are not interested in | 10:37 |
@wiking | see what i mean? | 10:37 |
micmn | yeah | 10:37 |
@wiking | these are just ideas | 10:37 |
@wiking | i'm not so sure which is the best idea to go with | 10:37 |
micmn | the CoW mechanism would be: until read so good, first write copy the features | 10:40 |
micmn | I mean cow would apply only to views | 10:41 |
@wiking | yes | 10:41 |
@wiking | it's a shit of course | 10:41 |
@wiking | when you for example have 5 views on the Features | 10:42 |
@wiking | and suddenly you centralise the original features | 10:42 |
@wiking | :)) | 10:42 |
@wiking | then you'll have 5 copies of the same thing right? | 10:42 |
micmn | :) | 10:42 |
@wiking | of course ideally | 10:42 |
@wiking | you just copy the elements that you are interested in | 10:42 |
@wiking | as it's a view | 10:43 |
@wiking | not the deep copy of that | 10:43 |
@wiking | right? | 10:43 |
micmn | yeah | 10:43 |
@wiking | i mean this is what would allow us to do | 10:43 |
@wiking | parallel xval | 10:43 |
@wiking | w/o wasting too much memory | 10:44 |
@wiking | i.e. no clone() :) | 10:44 |
@wiking | and in general | 10:44 |
@wiking | having an iterator interface for Features would be great to have | 10:45 |
@wiking | as currently we always do | 10:48 |
micmn | mmm actually what we iterate on? i mean there isn't a concept of 'Feature' right? indices? | 10:49 |
@wiking | for (index_t i =0 ; i < num_features(); ++i) | 10:49 |
@wiking | ... | 10:49 |
@wiking | Feature = SGVector<T> in case of DenseFeatures | 10:49 |
@wiking | http://shogun.ml/api/latest/classshogun_1_1CFeatures.html#a91f8bf82dad4bb05accdc606d85a0da3 | 10:50 |
@wiking | gives you the num vectors | 10:50 |
@wiking | and then you have http://shogun.ml/api/latest/singletonshogun_1_1CSparseFeatures.html#aef6eae81a9bc8c951de5493fe53adcdf | 10:51 |
@wiking | http://shogun.ml/api/latest/singletonshogun_1_1CDenseFeatures.html#a21e2db18e15e281b91e4ba6cabe747e9 | 10:51 |
@wiking | etc | 10:52 |
@wiking | but yeah | 10:52 |
@wiking | we dont have a generic Feature concept | 10:52 |
micmn | ok but say we iterate on SGVector and I write it -> how do I copy the whole subset? | 10:54 |
micmn | we 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 #shogun | 11:36 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 11: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 #shogun | 12:27 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 12:27 | |
@wiking | micmn, yeah i mean if you do iterators | 13:24 |
@wiking | it's worth to follow the usual | 13:24 |
@wiking | begin() cbegin() end() cend() kind of logic that c++11 has | 13:24 |
micmn | wiking: 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 features | 13:57 |
-!- iglesiasg [~iglesiasg@217.119.234.214] has joined #shogun | 13:57 | |
-!- mode/#shogun [+o iglesiasg] by ChanServ | 13:58 | |
@wiking | mmm yeah | 14:01 |
@wiking | question is how to deal with the case when the parent is being written to? | 14:02 |
@wiking | in case of the original Features... | 14:02 |
@wiking | because in that case you would need to initiate a copy as well or? | 14:02 |
micmn | good point | 14:03 |
@wiking | micmn, this is a good article about how shitty it can be to use CoW multithreaded: http://www.drdobbs.com/cpp/c-string-performance/184405453 | 14:12 |
micmn | thx | 14:14 |
@wiking | micmn, http://www.gotw.ca/publications/optimizations.htm | 14:15 |
@wiking | more interesting thigns | 14:15 |
@wiking | about how to do COW | 14:16 |
@wiking | and some benchmarks | 14:16 |
@wiking | and this is good as well | 14:17 |
@wiking | http://www.gotw.ca/gotw/045.htm | 14:17 |
@wiking | micmn, this is a quick review https://blogs.msmvps.com/gdicanio/2016/07/09/is-copy-on-write-really-a-pessimization-under-multithreading/ | 14:18 |
@wiking | micmn, as you can see folly's string replacement has cow implementation | 14:20 |
@wiking | i mean using this approach most of this is ready for you :) | 14:24 |
@wiking | although we are using refCounting for different purposes | 14:24 |
micmn | wiking: so you would use a refcounter for features -> copy everytime refcount > 1 i.e. original features too | 14:31 |
micmn | but the current sgobject counter? | 14:32 |
-!- HeikoS [~heiko@host-92-0-169-11.as43234.net] has quit [Quit: Leaving.] | 14:37 | |
@wiking | well that's the thing | 14:41 |
@wiking | with the current sgobject counter | 14:41 |
@wiking | we cannot do this | 14:41 |
@wiking | right? | 14:41 |
@wiking | or i mean you can do it | 14:42 |
@wiking | but quite in a tricky way | 14:42 |
@wiking | of course nothing says you cannot reuse the refcounter class | 14:44 |
@wiking | and use that separately | 14:44 |
micmn | that it's already thread safe no? | 14:44 |
@wiking | the refcounter in shogun | 14:45 |
@wiking | yes | 14:45 |
@wiking | it is | 14:45 |
@wiking | using atomic | 14:45 |
-!- HeikoS [~heiko@host-92-0-169-11.as43234.net] has joined #shogun | 16:47 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 16:47 | |
-!- iglesiasg [~iglesiasg@217.119.234.214] has quit [Quit: leaving] | 17:13 | |
@wiking | micmn, you wanna have some drafts going on in a gist? | 17:28 |
micmn | wiking: 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 |
@wiking | nono it's fine | 17:39 |
@wiking | just wondering how you wanna do it | 17:39 |
@wiking | btw once you have the gist could you share it with HeikoS as well plz | 17:39 |
@HeikoS | yep! | 17:40 |
micmn | sure! | 17:42 |
@wiking | thnx | 17: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 #shogun | 18: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 #shogun | 19:09 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 19:09 | |
-!- HeikoS [~heiko@host-92-0-169-11.as43234.net] has quit [Ping timeout: 240 seconds] | 19:14 | |
@wiking | btw https://arxiv.org/pdf/1611.09957.pdf | 19:59 |
@wiking | lisitsyn, ^ | 20:01 |
-!- olinguyen [81615ad9@gateway/web/freenode/ip.129.97.90.217] has joined #shogun | 20:40 | |
--- Log closed Thu Aug 03 00:00:22 2017 |
Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!