Open in new window / Try shogun cloud
--- Log opened Fri Sep 30 00:00:12 2016
-!- GandalfTheWizard [~Emma@112.10.170.120] has joined #shogun08:44
-!- HeikoS [~heiko@untrust-out.swc.ucl.ac.uk] has joined #shogun13:31
-!- mode/#shogun [+o HeikoS] by ChanServ13:31
-!- travis-ci [~travis-ci@ec2-54-196-200-41.compute-1.amazonaws.com] has joined #shogun14:39
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/16399011414:40
-!- travis-ci [~travis-ci@ec2-54-196-200-41.compute-1.amazonaws.com] has left #shogun []14:40
@HeikoSwiking: jo15:29
@HeikoSrandom c15:29
@HeikoSc++ question15:29
@HeikoSlisitsyn: around?15:29
lisitsynyeap15:29
lisitsynHeikoS: hey15:30
@HeikoSlisitsyn: cool so I want this:15:30
@HeikoSmember of a class that I never want to  modify, i.e. only call const methods15:30
@HeikoSbut I might want to change that member itself15:30
@HeikoSi.e. I want a setter for it15:30
@HeikoSso I cannot make it const15:30
@HeikoSlisitsyn: is that possible?15:30
lisitsynconst_cast15:30
@HeikoSIll google it thanks! :)15:31
@HeikoSlisitsyn: any caveats?15:31
@wikinglisitsyn: a15:41
@wikinglisitsyn: aaa15:41
@wikingHeikoS: or mutable15:41
@HeikoSwiking: mutable , what do I google for?15:42
@HeikoSdont like const_cast15:42
@wikingHeikoS: http://en.cppreference.com/w/cpp/keyword/mutable15:42
@wikinghttp://en.cppreference.com/w/cpp/language/cv15:42
@HeikoSwiking: cool thanks!15:42
@HeikoSI am doing this in some of my research code, but I think Shogun should also receive some const love15:42
@HeikoSwiking:, so as I understand this, I can make the thing const volatile, and then use const_cast to change its value?15:48
@wikingno15:52
@wikingso15:53
@wikingsay you have15:53
@wikingclass A {15:53
@wikingint x;15:53
@wiking};15:53
@wikingthen if you define15:53
@HeikoSLet me give an example of what I want15:53
@wikingint lala(int z) const { x = z*2; }15:53
@wikingthen you'll get a compile error right?15:53
@wikingbut15:53
@HeikoSyeah sure15:53
@wikingif you define15:53
@wikingclass A {15:53
@HeikoSbut its a bit different to what I want15:53
@wikingmutable int x;15:54
@wiking}15:54
@wikingthen you will not have a problem15:54
@wikingwith that const method15:54
@HeikoSkk I get that15:54
@wikingok so what is the problemo?15:54
@HeikoSso what I want15:54
@HeikoSI have a class that has a member, say a matrix15:54
@HeikoSand I want to guarantee that I never change the contents of that15:54
@HeikoSbut I want to maybe put another matrix after I instantiated the class15:54
@HeikoSsay a setter for the matrix15:54
@wikingmm i guess you feel the contradiction15:55
@wikingright? :)15:55
@HeikoSno wait15:55
@wikingyou dont want it to change15:55
@HeikoSso I want a member15:55
@wikingbut then want it to change15:55
@HeikoSwhere I am only allowed to call const methods on15:55
@HeikoSbut I might want to change that member15:55
@HeikoSthe member itself can change15:55
@wikingi see15:56
@HeikoSbut I want to guarantee that I only ever call const methods on there since I want to guarantee that I dont modify the state of the member object15:56
@HeikoSi.e. readonly access15:56
@wikingyep i understand15:56
@HeikoSlike any shogun algo should guarantee :)15:56
@HeikoSto the features one passes15:56
@wikingfucking immutable objects15:56
@wikingthey are the worst :)15:56
@wikingeverybody is wanking on this nowadays15:56
@HeikoShehe15:56
@HeikoSI dont even know how I do that15:57
@HeikoSI mean cast_const would work I guess, but thats ugly15:57
@HeikoSI can "unconst" the member, assign15:57
@HeikoSand somehow make the compiler not optimize it15:57
@HeikoSbut thats not nice15:57
@HeikoSI want something nice :)15:57
@wikingbut i dont eundstand15:58
@HeikoSso immutable but assignable member15:58
@wikingi mean it's easy15:58
@wikingyou have a private property15:58
@wikingand then all operations on it are15:58
@wikingllla const15:58
@wikingand you have only one fuction15:58
@wikingthat is a setter of that private property15:58
@wikingthat is none-const15:58
@wikingwhat's the problem with that?15:58
@HeikoSsure from outside I can protect15:59
@HeikoSbut what about subclass15:59
@wikingprivate15:59
@HeikoSah yes15:59
@wikingit doesn't inherit15:59
@HeikoSmmh15:59
@HeikoSthe thing is I wanted to get a compile error if I call non-const method on the member15:59
@HeikoSbut yeah it could work via a return15:59
@HeikoSand a private member15:59
@HeikoSa bit weird in my eyes16:00
@HeikoSwould rather have an immutable keyword or so16:00
@wikingconst16:00
@wikingand then you const_cast it16:00
@wikingi mean you only do that const_Cast once16:00
@wikingwhen you do the setting of that pointer16:00
@wikingright?16:00
@HeikoSin the setter, yes16:01
@wikingso?16:01
@HeikoSis that defined?16:01
@wikingthat should be goodenough16:01
@wiking:)16:01
@HeikoSor do I need to be careful with optimizer=?16:01
@wikingmmm no16:01
@wikingok i'm baking my bread now :)16:01
@HeikoSok let me try16:01
@HeikoSwiking: really? :D :D16:01
@HeikoSlet me send you something16:01
@wikingyeah16:01
@wikingi'm baking bread for 3 months now16:02
@wikingsourdough home made bread16:02
@wikingbut the problem is that i dont know yet how to do high hydratation bread16:02
@wiking:S16:02
@HeikoShaha16:03
@HeikoSman16:03
@HeikoSI am SO into this16:03
@HeikoSwhich recipe are you using?16:04
@HeikoStartine style?16:04
@HeikoSwiking: ^16:09
@HeikoSI do 400g of water for 500g of whole wheat flour16:09
@HeikoSpretty wet ;)16:09
@wikinghow do fuck16:15
@wikingdo you dong get it to stick to everything?!16:15
@wikingthe dough is so fucked up16:15
@wikingi see everybody has a super high tension dough16:15
@wikingmine is fucking sticking to EVERYTHING16:15
@wikingeven to the silicon matt16:16
@wikingi've tried now for the second time16:17
@wikinga 75% dough16:17
@wikingand it's fucking sticking TO EERYTING16:17
@wikingi cannot handle it16:17
@wikingand now it's already so fucking degassed16:18
@wikingi wanna through it out :D16:18
@wikingfor the 2nd time16:18
@wikingwoah those look great16:19
@wikingi cannot make that high hydra dough16:19
@wikingbtw i've using 40% whole wheat flour16:19
@wiking60% white16:19
@wikinglemme know if you know a good way16:20
@wikingas i'm about to give up16:20
@wikingand go back to my shitty none high hydra bread :)16:20
@HeikoShahaha16:20
@HeikoSI had this when I started16:20
@wikingthose are good as well16:20
@HeikoStook me a while16:20
@HeikoSwe should make some in SF16:20
@HeikoSapparently the climate is really well16:21
@wikingbut yeah would like to learn how to make the real one :)16:21
@wikingheheh here everything grows like hell16:21
@wikingthe sourdough i can get started16:21
@HeikoSuse a bit less water to start with16:21
@wikingin 4 hours16:21
@wiking:P16:21
@HeikoSit is all in the shaping16:21
@HeikoSI can bring some of my starter16:21
@HeikoSits 3 years old :)16:21
@wikinghehe dont take it16:21
@wikingthey'll just cause trouble for you'16:21
@wikingusa food importation16:22
@wikingis really shitty16:22
@HeikoSreally?16:22
@HeikoSah16:22
@HeikoSok16:22
@HeikoSwe can get some locally16:22
@wikingyeap16:22
@HeikoSthe tartine approach works really well for me16:22
@wikingbut yeah the starter is not a problem for me16:22
@HeikoSin their first book16:22
@wikingit looks really good16:22
@HeikoSthe numbers are good16:22
@HeikoSand it *is* sticky16:22
@wikingand it really grows the dough as well16:22
@HeikoSit requires careful handling16:22
@HeikoSneed to watch a video on the stretching and shaping16:22
@wikingbut i dont know how the fuck one can make that surface tension16:22
@HeikoSthat helped me16:22
@wikingthat i see in the videos16:22
@HeikoSyeah16:23
@HeikoSit is the handling16:23
@HeikoSkind of minimal yet dynamic16:23
@wikingi see :)16:23
@HeikoSfew movements but with lots of intention16:23
@HeikoSand I often use the spatula16:23
@wikingbtw do you put it in the fridge16:23
@HeikoSmakes it easier16:23
@HeikoSyeah16:23
@HeikoS8 hrs16:23
@wikinghahah ok16:23
@wiking:)16:23
@wikingnext time16:23
@HeikoSso much better with that16:23
@HeikoSI do16:23
@wikingi need breat NOW16:23
@HeikoS30m or longer autolyse (sometimes overnight but then without the leaven added yet)16:24
@HeikoS2 hrs with stretching every 30 mins16:24
@HeikoS2 hrs without touching16:24
@HeikoS(some of it in some controlled temperature environment like my oven with light on)16:24
@HeikoSthen shape, 20 min bench reset, then fridge over night16:24
@HeikoSok gotta go to talk now16:24
@HeikoSsee you later16:24
@HeikoSbtw16:24
@HeikoSthere is a guy reccomending for immutable members16:25
@HeikoSthe setter returns a new instance of the object16:25
@HeikoSnot so sure about that16:25
@HeikoSlike the private one more16:25
@HeikoShttps://en.wikipedia.org/wiki/Immutable_object#C.2B.2B16:26
@HeikoSwiking: lets definitely bake in SF :)16:28
@HeikoSalso : lets book flat soon!16:28
-!- HeikoS [~heiko@untrust-out.swc.ucl.ac.uk] has quit [Remote host closed the connection]16:28
-!- HeikoS_mobile [~Mutter@nat-8-27.internal.eduroam.ucl.ac.uk] has joined #shogun16:41
-!- HeikoS_mobile [~Mutter@nat-8-27.internal.eduroam.ucl.ac.uk] has quit [Remote host closed the connection]16:44
-!- HeikoS_mobile [~Mutter@nat-8-27.internal.eduroam.ucl.ac.uk] has joined #shogun16:47
-!- HeikoS_mobile [~Mutter@nat-8-27.internal.eduroam.ucl.ac.uk] has quit [Remote host closed the connection]16:53
-!- HeikoS [~heiko@untrust-out.swc.ucl.ac.uk] has joined #shogun17:07
-!- mode/#shogun [+o HeikoS] by ChanServ17:07
-!- OXPHOS [92bd305b@gateway/web/freenode/ip.146.189.48.91] has joined #shogun17:08
-!- HeikoS [~heiko@untrust-out.swc.ucl.ac.uk] has quit [Quit: Leaving.]17:19
-!- HeikoS [~heiko@untrust-out.swc.ucl.ac.uk] has joined #shogun17:19
-!- mode/#shogun [+o HeikoS] by ChanServ17:19
-!- HeikoS [~heiko@untrust-out.swc.ucl.ac.uk] has quit [Client Quit]17:19
-!- HeikoS [~heiko@untrust-out.swc.ucl.ac.uk] has joined #shogun17:22
-!- mode/#shogun [+o HeikoS] by ChanServ17:22
@HeikoSwiking: back17:23
@HeikoSlisitsyn:  you still there?17:23
lisitsynHeikoS: yeah sort of17:23
@HeikoSlisitsyn:  so about this immutable member thing17:24
lisitsynokay what's with that17:24
@HeikoSmake it private and provide a public getter that returns const version?17:24
@HeikoSor is there a cleaner way?17:24
lisitsynuhmm it is nice17:24
lisitsynI don't think you need any other17:25
lisitsynit depends17:25
@HeikoSjust a bit annoying that I have to use the method everywhere17:25
lisitsynif you don't want to change it by chacne17:25
@HeikoSthe other way would be to return new instance from setter17:25
@HeikoSJava like17:25
@HeikoSI am also thinking what the best way to do this in shogun would be17:25
@HeikoSlike have read only features17:25
lisitsynpimpl17:25
lisitsyn:D17:25
@HeikoSwhat if you have a SGMatrix member?17:26
lisitsynpimpl forces you to use getter17:26
lisitsynyou can't use anything but getter in pimpl17:26
lisitsynyou don't see the member anyway17:26
lisitsynI like to name it 'self' like in python17:27
lisitsynthis way you have to use17:27
@HeikoSnot sure I get that17:27
lisitsynself->blabla()17:27
@HeikoSso if I have algo class17:28
@HeikoSand it has a SGMatrix member17:28
@HeikoSthat I want to guarantee that it is not changed17:28
lisitsynreturn const SGMatrix&17:28
lisitsynand provide setter17:28
lisitsyngetter + setter17:28
@HeikoSkk17:28
@HeikoSso private does it then17:28
lisitsynyeah17:28
@HeikoSok then Ill do that17:28
@HeikoSthanks!17:29
lisitsynHeikoS: if you want to defend it from being changed by chane17:29
lisitsynby some internal code17:29
lisitsynit is a bit more diffucult17:29
@HeikoSIf it is private there is some reasonable safety I guess?17:29
lisitsynbut you can decouple with interfaces17:29
lisitsynnot really17:29
lisitsynyou can change kernel width in train()17:29
lisitsynorr17:29
lisitsynchange kernel width in compute()17:30
lisitsynrather that17:30
@HeikoSso in general, how to deal with this problem in shogun?17:30
lisitsynI guess narrowing it to get/set17:30
lisitsynis the way to go17:31
@HeikoSand then const-ing them properly17:31
@HeikoSand making all members private17:31
@HeikoS?17:31
lisitsynno only private but hidden at all17:31
lisitsynnot only*17:31
@HeikoSas in using your tags?17:31
@HeikoShow to hide?17:31
lisitsynyeah17:31
lisitsyninterface17:31
@HeikoShttps://en.wikipedia.org/wiki/Immutable_object#C.2B.2B17:32
@HeikoSlisitsyn: this is example on wiki17:32
@HeikoSthey provide one getter each for const and non const case17:32
lisitsynI am not a fan of mutable17:32
@HeikoSsee first example17:32
@HeikoSthe one without mutable17:32
lisitsynyeah it is good but you don't enforce using get/set17:33
@HeikoShow to hide the members then?17:33
lisitsynone more class17:34
lisitsyn:D17:34
@HeikoSwith all data?17:34
lisitsynyeah17:34
@HeikoSuh17:34
lisitsynit is hardcore and ugly17:34
@HeikoSyeah ugly17:34
@HeikoSin Shogun we have the tags17:34
@HeikoSI guess that does it for us?17:34
lisitsynyes17:34
@HeikoSbut then the read/write access is tricky with them as well17:35
@HeikoSI mean making things like: this algo guarantees not to change data matrix17:35
lisitsynah17:35
@HeikoScontents of matrix I mean17:35
lisitsynI see17:35
lisitsyndo you really need that?17:35
@HeikoScan work on multiple matrices, but never changes the numbers17:35
@HeikoSwould be cool in xvalidation with mutliple threads e.g.17:36
@HeikoScurrently we just "trust" that nothing is changed in the data17:36
lisitsynyeap17:36
@HeikoSbut if the machine has an inplace preprocessor, it just produces fuck17:36
lisitsynok the general principle I guess17:36
lisitsynis to use interfaces17:36
lisitsynit can be const then17:37
@HeikoSyeah17:37
@HeikoSI mean features should kind of be read-only by default17:37
@HeikoSand all methods const17:37
-!- travis-ci [~travis-ci@ec2-54-90-84-126.compute-1.amazonaws.com] has joined #shogun19:04
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/16406906819:04
-!- travis-ci [~travis-ci@ec2-54-90-84-126.compute-1.amazonaws.com] has left #shogun []19:04
-!- HeikoS [~heiko@untrust-out.swc.ucl.ac.uk] has quit [Ping timeout: 244 seconds]19:36
-!- HeikoS [~heiko@untrust-out.swc.ucl.ac.uk] has joined #shogun19:39
-!- mode/#shogun [+o HeikoS] by ChanServ19:39
-!- travis-ci [~travis-ci@ec2-54-90-84-126.compute-1.amazonaws.com] has joined #shogun19:44
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/16407578519:44
-!- travis-ci [~travis-ci@ec2-54-90-84-126.compute-1.amazonaws.com] has left #shogun []19:44
-!- OXPHOS [92bd305b@gateway/web/freenode/ip.146.189.48.91] has quit [Quit: Page closed]22:00
-!- HeikoS [~heiko@untrust-out.swc.ucl.ac.uk] has quit [Quit: Leaving.]22:38
-!- rekado [~rekado@2a03:f80:ed15:151:236:13:15:1] has quit [Quit: ZNC - http://znc.in]22:58
--- Log closed Sat Oct 01 00:00:13 2016