--- Log opened Fri Sep 30 00:00:12 2016 | ||
-!- GandalfTheWizard [~Emma@112.10.170.120] has joined #shogun | 08:44 | |
-!- HeikoS [~heiko@untrust-out.swc.ucl.ac.uk] has joined #shogun | 13:31 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 13:31 | |
-!- travis-ci [~travis-ci@ec2-54-196-200-41.compute-1.amazonaws.com] has joined #shogun | 14:39 | |
travis-ci | it'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/163990114 | 14:40 |
---|---|---|
-!- travis-ci [~travis-ci@ec2-54-196-200-41.compute-1.amazonaws.com] has left #shogun [] | 14:40 | |
@HeikoS | wiking: jo | 15:29 |
@HeikoS | random c | 15:29 |
@HeikoS | c++ question | 15:29 |
@HeikoS | lisitsyn: around? | 15:29 |
lisitsyn | yeap | 15:29 |
lisitsyn | HeikoS: hey | 15:30 |
@HeikoS | lisitsyn: cool so I want this: | 15:30 |
@HeikoS | member of a class that I never want to modify, i.e. only call const methods | 15:30 |
@HeikoS | but I might want to change that member itself | 15:30 |
@HeikoS | i.e. I want a setter for it | 15:30 |
@HeikoS | so I cannot make it const | 15:30 |
@HeikoS | lisitsyn: is that possible? | 15:30 |
lisitsyn | const_cast | 15:30 |
@HeikoS | Ill google it thanks! :) | 15:31 |
@HeikoS | lisitsyn: any caveats? | 15:31 |
@wiking | lisitsyn: a | 15:41 |
@wiking | lisitsyn: aaa | 15:41 |
@wiking | HeikoS: or mutable | 15:41 |
@HeikoS | wiking: mutable , what do I google for? | 15:42 |
@HeikoS | dont like const_cast | 15:42 |
@wiking | HeikoS: http://en.cppreference.com/w/cpp/keyword/mutable | 15:42 |
@wiking | http://en.cppreference.com/w/cpp/language/cv | 15:42 |
@HeikoS | wiking: cool thanks! | 15:42 |
@HeikoS | I am doing this in some of my research code, but I think Shogun should also receive some const love | 15:42 |
@HeikoS | wiking:, so as I understand this, I can make the thing const volatile, and then use const_cast to change its value? | 15:48 |
@wiking | no | 15:52 |
@wiking | so | 15:53 |
@wiking | say you have | 15:53 |
@wiking | class A { | 15:53 |
@wiking | int x; | 15:53 |
@wiking | }; | 15:53 |
@wiking | then if you define | 15:53 |
@HeikoS | Let me give an example of what I want | 15:53 |
@wiking | int lala(int z) const { x = z*2; } | 15:53 |
@wiking | then you'll get a compile error right? | 15:53 |
@wiking | but | 15:53 |
@HeikoS | yeah sure | 15:53 |
@wiking | if you define | 15:53 |
@wiking | class A { | 15:53 |
@HeikoS | but its a bit different to what I want | 15:53 |
@wiking | mutable int x; | 15:54 |
@wiking | } | 15:54 |
@wiking | then you will not have a problem | 15:54 |
@wiking | with that const method | 15:54 |
@HeikoS | kk I get that | 15:54 |
@wiking | ok so what is the problemo? | 15:54 |
@HeikoS | so what I want | 15:54 |
@HeikoS | I have a class that has a member, say a matrix | 15:54 |
@HeikoS | and I want to guarantee that I never change the contents of that | 15:54 |
@HeikoS | but I want to maybe put another matrix after I instantiated the class | 15:54 |
@HeikoS | say a setter for the matrix | 15:54 |
@wiking | mm i guess you feel the contradiction | 15:55 |
@wiking | right? :) | 15:55 |
@HeikoS | no wait | 15:55 |
@wiking | you dont want it to change | 15:55 |
@HeikoS | so I want a member | 15:55 |
@wiking | but then want it to change | 15:55 |
@HeikoS | where I am only allowed to call const methods on | 15:55 |
@HeikoS | but I might want to change that member | 15:55 |
@HeikoS | the member itself can change | 15:55 |
@wiking | i see | 15:56 |
@HeikoS | but 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 object | 15:56 |
@HeikoS | i.e. readonly access | 15:56 |
@wiking | yep i understand | 15:56 |
@HeikoS | like any shogun algo should guarantee :) | 15:56 |
@HeikoS | to the features one passes | 15:56 |
@wiking | fucking immutable objects | 15:56 |
@wiking | they are the worst :) | 15:56 |
@wiking | everybody is wanking on this nowadays | 15:56 |
@HeikoS | hehe | 15:56 |
@HeikoS | I dont even know how I do that | 15:57 |
@HeikoS | I mean cast_const would work I guess, but thats ugly | 15:57 |
@HeikoS | I can "unconst" the member, assign | 15:57 |
@HeikoS | and somehow make the compiler not optimize it | 15:57 |
@HeikoS | but thats not nice | 15:57 |
@HeikoS | I want something nice :) | 15:57 |
@wiking | but i dont eundstand | 15:58 |
@HeikoS | so immutable but assignable member | 15:58 |
@wiking | i mean it's easy | 15:58 |
@wiking | you have a private property | 15:58 |
@wiking | and then all operations on it are | 15:58 |
@wiking | llla const | 15:58 |
@wiking | and you have only one fuction | 15:58 |
@wiking | that is a setter of that private property | 15:58 |
@wiking | that is none-const | 15:58 |
@wiking | what's the problem with that? | 15:58 |
@HeikoS | sure from outside I can protect | 15:59 |
@HeikoS | but what about subclass | 15:59 |
@wiking | private | 15:59 |
@HeikoS | ah yes | 15:59 |
@wiking | it doesn't inherit | 15:59 |
@HeikoS | mmh | 15:59 |
@HeikoS | the thing is I wanted to get a compile error if I call non-const method on the member | 15:59 |
@HeikoS | but yeah it could work via a return | 15:59 |
@HeikoS | and a private member | 15:59 |
@HeikoS | a bit weird in my eyes | 16:00 |
@HeikoS | would rather have an immutable keyword or so | 16:00 |
@wiking | const | 16:00 |
@wiking | and then you const_cast it | 16:00 |
@wiking | i mean you only do that const_Cast once | 16:00 |
@wiking | when you do the setting of that pointer | 16:00 |
@wiking | right? | 16:00 |
@HeikoS | in the setter, yes | 16:01 |
@wiking | so? | 16:01 |
@HeikoS | is that defined? | 16:01 |
@wiking | that should be goodenough | 16:01 |
@wiking | :) | 16:01 |
@HeikoS | or do I need to be careful with optimizer=? | 16:01 |
@wiking | mmm no | 16:01 |
@wiking | ok i'm baking my bread now :) | 16:01 |
@HeikoS | ok let me try | 16:01 |
@HeikoS | wiking: really? :D :D | 16:01 |
@HeikoS | let me send you something | 16:01 |
@wiking | yeah | 16:01 |
@wiking | i'm baking bread for 3 months now | 16:02 |
@wiking | sourdough home made bread | 16:02 |
@wiking | but the problem is that i dont know yet how to do high hydratation bread | 16:02 |
@wiking | :S | 16:02 |
@HeikoS | haha | 16:03 |
@HeikoS | man | 16:03 |
@HeikoS | I am SO into this | 16:03 |
@HeikoS | which recipe are you using? | 16:04 |
@HeikoS | tartine style? | 16:04 |
@HeikoS | wiking: ^ | 16:09 |
@HeikoS | I do 400g of water for 500g of whole wheat flour | 16:09 |
@HeikoS | pretty wet ;) | 16:09 |
@wiking | how do fuck | 16:15 |
@wiking | do you dong get it to stick to everything?! | 16:15 |
@wiking | the dough is so fucked up | 16:15 |
@wiking | i see everybody has a super high tension dough | 16:15 |
@wiking | mine is fucking sticking to EVERYTHING | 16:15 |
@wiking | even to the silicon matt | 16:16 |
@wiking | i've tried now for the second time | 16:17 |
@wiking | a 75% dough | 16:17 |
@wiking | and it's fucking sticking TO EERYTING | 16:17 |
@wiking | i cannot handle it | 16:17 |
@wiking | and now it's already so fucking degassed | 16:18 |
@wiking | i wanna through it out :D | 16:18 |
@wiking | for the 2nd time | 16:18 |
@wiking | woah those look great | 16:19 |
@wiking | i cannot make that high hydra dough | 16:19 |
@wiking | btw i've using 40% whole wheat flour | 16:19 |
@wiking | 60% white | 16:19 |
@wiking | lemme know if you know a good way | 16:20 |
@wiking | as i'm about to give up | 16:20 |
@wiking | and go back to my shitty none high hydra bread :) | 16:20 |
@HeikoS | hahaha | 16:20 |
@HeikoS | I had this when I started | 16:20 |
@wiking | those are good as well | 16:20 |
@HeikoS | took me a while | 16:20 |
@HeikoS | we should make some in SF | 16:20 |
@HeikoS | apparently the climate is really well | 16:21 |
@wiking | but yeah would like to learn how to make the real one :) | 16:21 |
@wiking | heheh here everything grows like hell | 16:21 |
@wiking | the sourdough i can get started | 16:21 |
@HeikoS | use a bit less water to start with | 16:21 |
@wiking | in 4 hours | 16:21 |
@wiking | :P | 16:21 |
@HeikoS | it is all in the shaping | 16:21 |
@HeikoS | I can bring some of my starter | 16:21 |
@HeikoS | its 3 years old :) | 16:21 |
@wiking | hehe dont take it | 16:21 |
@wiking | they'll just cause trouble for you' | 16:21 |
@wiking | usa food importation | 16:22 |
@wiking | is really shitty | 16:22 |
@HeikoS | really? | 16:22 |
@HeikoS | ah | 16:22 |
@HeikoS | ok | 16:22 |
@HeikoS | we can get some locally | 16:22 |
@wiking | yeap | 16:22 |
@HeikoS | the tartine approach works really well for me | 16:22 |
@wiking | but yeah the starter is not a problem for me | 16:22 |
@HeikoS | in their first book | 16:22 |
@wiking | it looks really good | 16:22 |
@HeikoS | the numbers are good | 16:22 |
@HeikoS | and it *is* sticky | 16:22 |
@wiking | and it really grows the dough as well | 16:22 |
@HeikoS | it requires careful handling | 16:22 |
@HeikoS | need to watch a video on the stretching and shaping | 16:22 |
@wiking | but i dont know how the fuck one can make that surface tension | 16:22 |
@HeikoS | that helped me | 16:22 |
@wiking | that i see in the videos | 16:22 |
@HeikoS | yeah | 16:23 |
@HeikoS | it is the handling | 16:23 |
@HeikoS | kind of minimal yet dynamic | 16:23 |
@wiking | i see :) | 16:23 |
@HeikoS | few movements but with lots of intention | 16:23 |
@HeikoS | and I often use the spatula | 16:23 |
@wiking | btw do you put it in the fridge | 16:23 |
@HeikoS | makes it easier | 16:23 |
@HeikoS | yeah | 16:23 |
@HeikoS | 8 hrs | 16:23 |
@wiking | hahah ok | 16:23 |
@wiking | :) | 16:23 |
@wiking | next time | 16:23 |
@HeikoS | so much better with that | 16:23 |
@HeikoS | I do | 16:23 |
@wiking | i need breat NOW | 16:23 |
@HeikoS | 30m or longer autolyse (sometimes overnight but then without the leaven added yet) | 16:24 |
@HeikoS | 2 hrs with stretching every 30 mins | 16:24 |
@HeikoS | 2 hrs without touching | 16:24 |
@HeikoS | (some of it in some controlled temperature environment like my oven with light on) | 16:24 |
@HeikoS | then shape, 20 min bench reset, then fridge over night | 16:24 |
@HeikoS | ok gotta go to talk now | 16:24 |
@HeikoS | see you later | 16:24 |
@HeikoS | btw | 16:24 |
@HeikoS | there is a guy reccomending for immutable members | 16:25 |
@HeikoS | the setter returns a new instance of the object | 16:25 |
@HeikoS | not so sure about that | 16:25 |
@HeikoS | like the private one more | 16:25 |
@HeikoS | https://en.wikipedia.org/wiki/Immutable_object#C.2B.2B | 16:26 |
@HeikoS | wiking: lets definitely bake in SF :) | 16:28 |
@HeikoS | also : 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 #shogun | 16: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 #shogun | 16: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 #shogun | 17:07 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 17:07 | |
-!- OXPHOS [92bd305b@gateway/web/freenode/ip.146.189.48.91] has joined #shogun | 17: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 #shogun | 17:19 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 17: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 #shogun | 17:22 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 17:22 | |
@HeikoS | wiking: back | 17:23 |
@HeikoS | lisitsyn: you still there? | 17:23 |
lisitsyn | HeikoS: yeah sort of | 17:23 |
@HeikoS | lisitsyn: so about this immutable member thing | 17:24 |
lisitsyn | okay what's with that | 17:24 |
@HeikoS | make it private and provide a public getter that returns const version? | 17:24 |
@HeikoS | or is there a cleaner way? | 17:24 |
lisitsyn | uhmm it is nice | 17:24 |
lisitsyn | I don't think you need any other | 17:25 |
lisitsyn | it depends | 17:25 |
@HeikoS | just a bit annoying that I have to use the method everywhere | 17:25 |
lisitsyn | if you don't want to change it by chacne | 17:25 |
@HeikoS | the other way would be to return new instance from setter | 17:25 |
@HeikoS | Java like | 17:25 |
@HeikoS | I am also thinking what the best way to do this in shogun would be | 17:25 |
@HeikoS | like have read only features | 17:25 |
lisitsyn | pimpl | 17:25 |
lisitsyn | :D | 17:25 |
@HeikoS | what if you have a SGMatrix member? | 17:26 |
lisitsyn | pimpl forces you to use getter | 17:26 |
lisitsyn | you can't use anything but getter in pimpl | 17:26 |
lisitsyn | you don't see the member anyway | 17:26 |
lisitsyn | I like to name it 'self' like in python | 17:27 |
lisitsyn | this way you have to use | 17:27 |
@HeikoS | not sure I get that | 17:27 |
lisitsyn | self->blabla() | 17:27 |
@HeikoS | so if I have algo class | 17:28 |
@HeikoS | and it has a SGMatrix member | 17:28 |
@HeikoS | that I want to guarantee that it is not changed | 17:28 |
lisitsyn | return const SGMatrix& | 17:28 |
lisitsyn | and provide setter | 17:28 |
lisitsyn | getter + setter | 17:28 |
@HeikoS | kk | 17:28 |
@HeikoS | so private does it then | 17:28 |
lisitsyn | yeah | 17:28 |
@HeikoS | ok then Ill do that | 17:28 |
@HeikoS | thanks! | 17:29 |
lisitsyn | HeikoS: if you want to defend it from being changed by chane | 17:29 |
lisitsyn | by some internal code | 17:29 |
lisitsyn | it is a bit more diffucult | 17:29 |
@HeikoS | If it is private there is some reasonable safety I guess? | 17:29 |
lisitsyn | but you can decouple with interfaces | 17:29 |
lisitsyn | not really | 17:29 |
lisitsyn | you can change kernel width in train() | 17:29 |
lisitsyn | orr | 17:29 |
lisitsyn | change kernel width in compute() | 17:30 |
lisitsyn | rather that | 17:30 |
@HeikoS | so in general, how to deal with this problem in shogun? | 17:30 |
lisitsyn | I guess narrowing it to get/set | 17:30 |
lisitsyn | is the way to go | 17:31 |
@HeikoS | and then const-ing them properly | 17:31 |
@HeikoS | and making all members private | 17:31 |
@HeikoS | ? | 17:31 |
lisitsyn | no only private but hidden at all | 17:31 |
lisitsyn | not only* | 17:31 |
@HeikoS | as in using your tags? | 17:31 |
@HeikoS | how to hide? | 17:31 |
lisitsyn | yeah | 17:31 |
lisitsyn | interface | 17:31 |
@HeikoS | https://en.wikipedia.org/wiki/Immutable_object#C.2B.2B | 17:32 |
@HeikoS | lisitsyn: this is example on wiki | 17:32 |
@HeikoS | they provide one getter each for const and non const case | 17:32 |
lisitsyn | I am not a fan of mutable | 17:32 |
@HeikoS | see first example | 17:32 |
@HeikoS | the one without mutable | 17:32 |
lisitsyn | yeah it is good but you don't enforce using get/set | 17:33 |
@HeikoS | how to hide the members then? | 17:33 |
lisitsyn | one more class | 17:34 |
lisitsyn | :D | 17:34 |
@HeikoS | with all data? | 17:34 |
lisitsyn | yeah | 17:34 |
@HeikoS | uh | 17:34 |
lisitsyn | it is hardcore and ugly | 17:34 |
@HeikoS | yeah ugly | 17:34 |
@HeikoS | in Shogun we have the tags | 17:34 |
@HeikoS | I guess that does it for us? | 17:34 |
lisitsyn | yes | 17:34 |
@HeikoS | but then the read/write access is tricky with them as well | 17:35 |
@HeikoS | I mean making things like: this algo guarantees not to change data matrix | 17:35 |
lisitsyn | ah | 17:35 |
@HeikoS | contents of matrix I mean | 17:35 |
lisitsyn | I see | 17:35 |
lisitsyn | do you really need that? | 17:35 |
@HeikoS | can work on multiple matrices, but never changes the numbers | 17:35 |
@HeikoS | would be cool in xvalidation with mutliple threads e.g. | 17:36 |
@HeikoS | currently we just "trust" that nothing is changed in the data | 17:36 |
lisitsyn | yeap | 17:36 |
@HeikoS | but if the machine has an inplace preprocessor, it just produces fuck | 17:36 |
lisitsyn | ok the general principle I guess | 17:36 |
lisitsyn | is to use interfaces | 17:36 |
lisitsyn | it can be const then | 17:37 |
@HeikoS | yeah | 17:37 |
@HeikoS | I mean features should kind of be read-only by default | 17:37 |
@HeikoS | and all methods const | 17:37 |
-!- travis-ci [~travis-ci@ec2-54-90-84-126.compute-1.amazonaws.com] has joined #shogun | 19:04 | |
travis-ci | it'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/164069068 | 19: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 #shogun | 19:39 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 19:39 | |
-!- travis-ci [~travis-ci@ec2-54-90-84-126.compute-1.amazonaws.com] has joined #shogun | 19:44 | |
travis-ci | it'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/164075785 | 19: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 |
Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!