IRC logs of #shogun for Tuesday, 2019-06-04

--- Log opened Tue Jun 04 00:00:44 2019
-!- essam [c5340aa2@gateway/web/freenode/ip.197.52.10.162] has joined #shogun07:58
-!- essam [c5340aa2@gateway/web/freenode/ip.197.52.10.162] has quit [Ping timeout: 256 seconds]09:12
-!- wiking_ [~wiking@huwico/staff/wiking] has joined #shogun09:15
-!- mode/#shogun [+o wiking_] by ChanServ09:15
-!- wiking_ [~wiking@huwico/staff/wiking] has quit [Read error: Connection reset by peer]09:18
-!- gf712 [90520862@gateway/web/freenode/ip.144.82.8.98] has joined #shogun10:02
-!- essam [c5340aa2@gateway/web/freenode/ip.197.52.10.162] has joined #shogun11:50
gf712essam: hey, how did your exams go?11:52
essamsmoothly11:54
essamglad they're over though :"D11:55
gf712good! are you done with this academic year then?11:56
essamyes11:56
-!- abhinandan [67629c5b@gateway/web/freenode/ip.103.98.156.91] has joined #shogun12:57
-!- abhinandan [67629c5b@gateway/web/freenode/ip.103.98.156.91] has quit [Client Quit]12:58
essamgf712: I have a question. how to properly pass a part of an SGVector [l, h[ as an SGVector?14:51
gf712essam: i am not sure I understand what you mean? you mean to slice a range?14:55
essamyes14:57
gf712I don't think there is a way without making a copy14:57
gf712you could construct a new sgvector with the same underlying pointer and start from where you want until a given size15:00
gf712but then you have to be careful you don't leave end up with a dangling reference15:00
gf712essam: do you need a reference or a copy?15:01
essama reference of the data, but a copy of the SGVector15:02
essamI don't want to change the original SGVector15:02
essamif reference counting is enabled, can a dangling reference occur?15:02
gf712depends if the lifetime of the original is longer than the sliced version15:03
essamright, so if the original is shorter, a memory leak would happen15:03
gf712if it is shorted you have UB right?15:03
gf712because the destructor of the original will be called15:03
gf712and deallocate the pointer15:04
essamif reference counting is disabled in the slice15:04
gf712unless they share a refcounter15:04
gf712yup15:04
essami think if we want to get rid of raw pointers, we should have a mechanism for slicing15:04
gf712so for the slicing you would need a vector that shares the refcount with the original vector right?15:06
essamdense_dot is used at multiple places where a slice of a vector is used instead of the whole one15:06
gf712I am not sure if that is already possible15:06
gf712just having a look now15:06
essambut the slice should know about the whole vector i guess, so as to deallocate it correctly15:06
essamits original length and beginning15:07
gf712yes I agree15:07
gf712hmm or maybe it's own class?15:07
gf712I think that's what armadillo does15:07
gf712there are these slice objects15:08
gf712and I would assume they are aware of the original data15:08
essamarmadillo?15:08
gf712so that deallocation happens properly if the slice is the last reference15:08
gf712essam: http://arma.sourceforge.net15:09
gf712very cool project15:09
essamnice, I will take a look15:09
gf712does some linalg stuff and has containers for vectors, matrices and "cubes"15:10
gf712yea, might be worth having a look to see how slices are implemented there15:10
gf712because copying would be very innefficient15:10
essamcubes = 3d matrices?15:10
gf712and using references can be buggy15:10
gf712yes15:10
essamok thanks, I will check them out15:12
gf712essam: the slicing is done by arma::span, see http://arma.sourceforge.net/docs.html#submat15:13
essamslicing returns an instance of the same class15:14
essamwhich is mat there15:15
essamcool semantics. very python like15:16
gf712is it a copy?15:17
essamnot sure yet15:20
essamalso not sure about slicing. I didnt take operator overloading in consideration15:21
gf712yea, I don't think there would be an operator you could use, it's not like python where you can use [:N]15:24
gf712essam: so the subview classes hold references to the original data15:27
gf712and I guess the refcount is incremented that way15:28
gf712anyway, might be a whole project to get something like that working well15:28
essamshouldn't it be easy with SGVectors? they are not as general as tensors15:30
gf712hmm I guess, you could just have .slice(start, end)15:32
gf712end then create a new SGVector15:33
gf712but then you have to copy the refcounter15:33
essamthe refcounter is only a pointer right?15:33
gf712yup15:34
gf712it's private though I think15:34
gf712in shogun/lib/SGReferencedData.h15:34
gf712you can copy_refcount15:34
gf712I think that would work?15:34
gf712so inside slice have new_vec.copy_refcount(m_refcount)15:35
gf712and then increment the count once15:35
gf712with ref()15:35
gf712and the vector member would be just vec+start15:36
essamright, and have something like original_vlen15:36
gf712and Len would be end-start15:36
gf712that should be it no?15:36
gf712ah right yes15:36
gf712you still need to keep track of the original pointer15:37
essamyes, for deallocation15:37
essamso maybe something like orig_vlen and offset15:37
gf712yes exactly15:37
gf712I am not sure what the impact on performance will be15:38
gf712because then you need to check offset each time?15:38
essamno I wont check offset at all, I guess15:39
essamonly when slicing15:39
essamnew_vector = vector + offset15:39
essamwhen I deallocate, I will subtract it15:39
gf712ok, but what happens when you have:15:40
gf712auto new_vec = vec.slice(5,10)15:40
gf712new_vec.slice(0,2)15:40
gf712the 0 index is the offset right?15:40
gf712and if it's the same class, i.e. sgvector, you need to track it constantly15:41
essamI guess the offset should be accumulated then15:41
gf712ok, so just substract in destructor I guess won't be too bad15:41
gf712yea, seems fine with me actually15:42
essamcool15:42
gf712and how does it work when you want to use Eigen?15:42
gf712I guess that would be fine15:43
essamI guess the same15:43
gf712yup15:43
gf712I guess give it a try and run tests15:43
gf712see what happens15:43
gf712in theory it might work :D15:43
essamyea :"D15:43
gf712btw have you looked also at the GPU stuff?15:46
essamno not yet16:03
essami believe many of the linalg functions aren't implemented in the GPUBackend16:04
essamdo things work with gpu backend?16:06
gf712I am not sure as it isn't tested by the ci16:16
gf712I know that it used to be tested by Buildbot16:16
gf712but that is down right now16:16
gf712but we shouldn't break the GPU stuff more16:17
gf712essam: in any case start a PR and Viktor and heiko can see if it would break GPU stuff16:18
essamgf712: ok16:29
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun17:16
-!- mode/#shogun [+o wiking] by ChanServ17:16
-!- wiking [~wiking@huwico/staff/wiking] has quit [Read error: Connection reset by peer]17:27
-!- essam [c5340aa2@gateway/web/freenode/ip.197.52.10.162] has quit [Ping timeout: 256 seconds]17:34
-!- HeikoS [~heiko@131.pool85-48-187.static.orange.es] has joined #shogun17:46
-!- mode/#shogun [+o HeikoS] by ChanServ17:46
lisitsynHeikoS: hey!17:47
@HeikoSlisitsyn:  ho17:47
lisitsynwie gehts?17:47
@HeikoSgut :)17:47
lisitsynHeikoS: ^ preparing!17:47
@HeikoSand you?17:47
@HeikoShaha17:47
lisitsynich bin guuut!17:47
lisitsyn:D17:47
lisitsyndo you get there on thursday?17:48
@HeikoSi think yes17:48
@HeikoS6th17:48
@HeikoSlate in the evening17:48
@HeikoSand you again?17:49
lisitsynHeikoS: friday evening17:50
@HeikoSalright17:50
@HeikoSwe have a dinner confirmed on sat :)17:50
lisitsynHeikoS: korean? :)17:51
lisitsynHeikoS: what do we do on friday?17:51
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun17:51
-!- mode/#shogun [+o wiking] by ChanServ17:51
@HeikoSso the venue is 9-517:51
@HeikoSso all over by the time you arrive on Friday17:52
-!- wiking [~wiking@huwico/staff/wiking] has quit [Read error: Connection reset by peer]17:52
@HeikoSneed to think of something nice17:52
@HeikoSlisitsyn: cbase is an idea18:02
@HeikoSwe can hack / have a drink there on Friday eve18:02
lisitsynohh cbase is so bad :D18:02
lisitsynbut yeah why not18:02
-!- gf712 [90520862@gateway/web/freenode/ip.144.82.8.98] has quit [Ping timeout: 256 seconds]18:13
@HeikoShehe18:18
@HeikoSwe can also go somewhere else18:18
@HeikoSbad memories form the place lisitsyn? :D18:18
lisitsynHeikoS: it is dark and noisy18:19
@HeikoSit is18:19
@HeikoSbut you can pull out a computer as a large group there on a Friday night18:19
@HeikoSfew other places would like that in B18:19
lisitsynHeikoS: what about putting out our computers and be humans :D18:20
@HeikoShehe18:20
@HeikoSalso good18:20
@HeikoSlater definitely18:20
@HeikoSI guess I was talking about the time from 5-7 say18:20
@HeikoSyou know18:20
@HeikoStomtom kicks us out at 518:20
@HeikoSor rather sonney2k does18:20
@HeikoSbut I will ask him for ideas18:20
lisitsynHeikoS: yeah ok18:23
lisitsynHeikoS: so I guess I don't get to tomtom on friday18:23
lisitsynas I arrive slightly later than that18:23
@HeikoSyes you will come on sat18:23
-!- HeikoS [~heiko@131.pool85-48-187.static.orange.es] has quit [Ping timeout: 245 seconds]18:47
-!- gf712 [bcd58b26@gateway/web/freenode/ip.188.213.139.38] has joined #shogun19:00
shogun-buildbotBuild deb3 - interfaces #2 is complete: Success [build successful] - https://buildbot.shogun.ml/#builders/36/builds/219:38
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun20:37
-!- mode/#shogun [+o wiking] by ChanServ20:37
-!- gf712 [bcd58b26@gateway/web/freenode/ip.188.213.139.38] has quit [Quit: Page closed]21:10
--- Log closed Wed Jun 05 00:00:45 2019

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