--- Log opened Thu Jun 08 00:00:04 2017 | ||
-!- olinguyen [81615ad9@gateway/web/freenode/ip.129.97.90.217] has quit [Quit: Page closed] | 00:03 | |
-!- OXPHOS [92bd305b@gateway/web/freenode/ip.146.189.48.91] has quit [Quit: Page closed] | 00:33 | |
@sukey | Wiki page: How-can-we-get-the-data created on shogun-toolbox/shogun by xxnyufengzhe | 03:58 |
---|---|---|
@sukey | Issue #3839 "How can we get the data" opened by xxnyufengzhe - https://github.com/shogun-toolbox/shogun/issues/3839 | 04:01 |
@sukey | Issue #3839 "How can we get the data" closed by vigsterkr - https://github.com/shogun-toolbox/shogun/issues/3839 | 04:02 |
-!- mikeling [uid89706@gateway/web/irccloud.com/x-mwxnzdevzvoozsnr] has joined #shogun | 04:05 | |
mikeling | wiking: Hi, I see the comment. Thank you | 04:06 |
mikeling | how to deal with the problem that vector can't use bool as index? | 04:06 |
mikeling | I mean can't return something like &bool | 04:07 |
@wiking | you can specialize CDynamicArray<bool> to something else | 04:12 |
@wiking | and handle that somehow else | 04:12 |
@wiking | so yeah i mean with std::vector<bool> we have the same problem as in case of std::deque<T> | 04:15 |
@wiking | Does not necessarily store its elements as a contiguous array (so &v[0] + n != &v[n]) | 04:15 |
@wiking | mikeling, we might have arrived to the point | 04:24 |
@wiking | where one should say | 04:24 |
@wiking | that we cannot | 04:24 |
@wiking | do this | 04:24 |
@wiking | :) | 04:24 |
@wiking | i mean i'm sorry that i'm smiling | 04:24 |
@wiking | but this could be the reality unfortunately | 04:24 |
mikeling | wiking: oh, it's ok. I just hope I haven't waste too much time on it | 04:26 |
mikeling | :) | 04:26 |
mikeling | really really sorry about that | 04:27 |
@wiking | mmm | 04:27 |
@wiking | well | 04:27 |
@wiking | i think what one can do is that we use | 04:27 |
@wiking | std::vector<T> for everything | 04:27 |
@wiking | except bool | 04:27 |
@wiking | of course in this case one can ask himself | 04:27 |
@wiking | why wouldn't we use DynArray ;P | 04:27 |
@wiking | but it's fine | 04:29 |
@wiking | we wanna get rid of DynArray | 04:29 |
@wiking | so this will be the only exception where we need some hacking | 04:29 |
@wiking | do you know how to specialize one way or another a tempalte? | 04:29 |
@wiking | *template | 04:29 |
mikeling | sure, I think I can do it | 04:30 |
@wiking | mmm | 04:30 |
@wiking | wait wait | 04:30 |
@wiking | have you considered std::array | 04:30 |
@wiking | ? | 04:30 |
@wiking | it's since c++11 | 04:30 |
@wiking | "satisfies the requirements of ContiguousContainer" | 04:31 |
mikeling | mmmm, no I haven't | 04:31 |
mikeling | wiking: oh, I do think about it | 04:32 |
mikeling | but it's not dynimc | 04:32 |
mikeling | *dynamic | 04:32 |
@wiking | yeah | 04:32 |
@wiking | well | 04:32 |
mikeling | so, you need specify a length when you init it | 04:32 |
@wiking | you can wrap that under the CDynamicArray | 04:32 |
@wiking | yeye | 04:32 |
@wiking | but i mean you can keep resizing things | 04:32 |
@wiking | now | 04:32 |
@wiking | ? | 04:32 |
@wiking | :) | 04:32 |
mikeling | but I can't find function like push_back or resize in std::array | 04:33 |
@wiking | yes | 04:38 |
@wiking | you have to manually do the resizing | 04:38 |
@wiking | for that case maybe it's better to use valarray | 04:39 |
@wiking | as that one has at least .resize() | 04:39 |
@wiking | but | 04:39 |
@wiking | i'm not so sure how swig will react to this | 04:39 |
@wiking | although the same can be told about std::array | 04:40 |
@wiking | ok that works https://github.com/swig/swig/blob/master/Lib/std/std_array.i | 04:41 |
@wiking | mikeling, i mean essentially you would just need to do any of these hacks | 04:47 |
@wiking | for bool case | 04:47 |
@wiking | right? | 04:47 |
mikeling | yes, I argee. | 04:48 |
mikeling | ok, let's try array | 04:49 |
mikeling | then think about extend vector<bool> if it doesn't work | 04:49 |
-!- geektoni [~geektoni@93-34-234-212.ip52.fastwebnet.it] has joined #shogun | 08:34 | |
@sukey | New Commit "Merge branch 'feature/progress' into develop" to shogun-toolbox/shogun by vigsterkr: https://github.com/shogun-toolbox/shogun/commit/8d6f9c495e90da2d0fe1ac2c5cca2b6a5d0d397a | 08:53 |
@wiking | bingo | 08:53 |
@wiking | :) | 08:53 |
geektoni | :D nicee | 08:53 |
@wiking | geektoni, this way now you'll get a lot of test on different os/distrib | 08:53 |
@wiking | (see buildbot) | 08:53 |
geektoni | kk I like it ;) | 08:53 |
-!- iglesiasg [~iglesiasg@217.119.234.214] has joined #shogun | 09:16 | |
-!- mode/#shogun [+o iglesiasg] by ChanServ | 09:16 | |
@sukey | Pull Request #3840 "[SmartPointers] Port SGObject and its unit tests to Some<>." opened by geektoni - https://github.com/shogun-toolbox/shogun/pull/3840 | 10:39 |
geektoni | ping wiking | 10:40 |
@sukey | Pull Request #3840 "[SmartPointers] Port SGObject and its unit tests to Some<>." - https://github.com/shogun-toolbox/shogun/pull/3840 | 10:42 |
@wiking | geektoni, pong | 10:46 |
geektoni | regarding smart pointers, we agreed to first port SG_REF to Some<> and then change the method signatures. | 10:48 |
geektoni | However, I'm not so sure on how I have to proceed. | 10:48 |
geektoni | I mean, should I begin to work on changing the signature right now, or is it better to do it when all the code is ported to Some? | 10:49 |
@wiking | ah yeah | 10:49 |
@wiking | well | 10:49 |
@wiking | the problem is going to be of course | 10:49 |
@wiking | that passing Some<>-ed objc | 10:50 |
@wiking | you should change the signature | 10:50 |
@wiking | no?? | 10:50 |
@wiking | or you can of course always | 10:51 |
@wiking | do the .get() and pass then the pointer | 10:51 |
geektoni | yeah sure. For instance that happens with SGObject::clone(). | 10:51 |
@wiking | yeye | 10:52 |
@wiking | i see that | 10:52 |
@wiking | well look | 10:52 |
geektoni | ehehe depends if the Some<>-ed object is a return value of a method | 10:52 |
geektoni | in that case, .get() won't work | 10:52 |
@wiking | mmm | 10:53 |
@wiking | i mean in this case either way you do it is fine | 10:53 |
@wiking | on the end of the day | 10:53 |
@wiking | i'll squash that feature branch | 10:53 |
@wiking | so those intermediate changes will disappear | 10:53 |
@wiking | so i mean you can do the signature changes now | 10:54 |
@wiking | or later | 10:54 |
@wiking | or go one by one | 10:54 |
geektoni | kk | 10:54 |
@wiking | doesn't matter | 10:54 |
@wiking | do it the most easiest way | 10:54 |
geektoni | thnx | 10:55 |
lisitsyn | hey | 11:06 |
lisitsyn | geektoni: I'm a bit out of everything, does Some work well now? | 11:07 |
geektoni | hey lisitsyn, it seems so. I did some tests with valgrind and there were no particular problems. | 11:10 |
lisitsyn | oh what a relief ;) | 11:16 |
geektoni | ;) | 11:19 |
@iglesiasg | it deserves a small dance | 11:20 |
@iglesiasg | shogun-buildbot: dance | 11:20 |
shogun-buildbot | <(^.^<) | 11:20 |
shogun-buildbot | <(^.^)> | 11:20 |
shogun-buildbot | (>^.^)> | 11:20 |
shogun-buildbot | (7^.^)7 | 11:20 |
shogun-buildbot | (>^.^<) | 11:20 |
@iglesiasg | \o/ | 11:20 |
geektoni | inglesasg: ahaha nice :D can it do other things? ;) | 11:31 |
geektoni | *iglesiasg | 11:31 |
@iglesiasg | geektoni: I am not sure, let's check it | 11:45 |
@iglesiasg | shogun-buildbot: commands | 11:46 |
shogun-buildbot | buildbot commands: commands, dance, destroy, force, hello, help, last, list, mute, notify, shutdown, source, status, stop, unmute, version, watch | 11:46 |
@iglesiasg | lol destroy sounds dangerous | 11:46 |
geektoni | mmmh destroy | 11:46 |
geektoni | ahaha | 11:46 |
geektoni | yeah, I agree | 11:46 |
@iglesiasg | xD | 11:46 |
@iglesiasg | shogun-buildbot: hello | 11:46 |
shogun-buildbot | yes? | 11:46 |
@iglesiasg | haha the alexa precursor | 11:46 |
geektoni | alexa? | 11:47 |
@iglesiasg | have you heard of amazon echo and dot devices? | 11:47 |
@iglesiasg | alexa is in them | 11:47 |
geektoni | ehmm nope | 11:48 |
@iglesiasg | it is a service for voice recognition and doing stuff on response to it | 11:48 |
@iglesiasg | it can answer questions getting data from wikipedia, tell you about the weather, set alarms, stuff like that | 11:48 |
geektoni | it seems cool! Does it use only Wikipedia? | 11:49 |
@iglesiasg | it is something like siri in the iphone and the equivalent in android (google now?) | 11:50 |
@iglesiasg | I think it also uses other sources | 11:50 |
@iglesiasg | yesterday for instance I asked it about a movie and gave me the imdb score | 11:50 |
@iglesiasg | but well, the score could also be in wikipedia | 11:50 |
@iglesiasg | I find it a bit of a fancy toy | 11:51 |
@iglesiasg | but I was impressed with the quality of the voice recognizer, it worked better than I expected | 11:52 |
-!- leagoetz [~leagoetz@host-92-0-178-129.as43234.net] has joined #shogun | 11:54 | |
geektoni | Seems like a tool to carry out research projects. :P What are you using it for? :D | 11:54 |
leagoetz | hey guys, how is it going? | 11:55 |
leagoetz | has anyone seen Olivier in here recently | 11:55 |
@iglesiasg | geektoni: for fun and listening to music; nothing researchy :P | 11:56 |
geektoni | leagoetz: it's fine from my side :) | 11:56 |
@iglesiasg | leagoetz: I haven't been around the last two days, but from the logs I can see he connected to the channel | 11:57 |
@iglesiasg | geektoni: some of the fancier things I have heard are controlling lights at home, heating, and so via voice with it. Let's say smart house type of thigns | 11:59 |
geektoni | iglesiasg: because listening to music from just an iPod is too boring ;) | 12:03 |
@iglesiasg | geektoni: haha yeah | 12:04 |
@iglesiasg | I don't have a dolby or something like that, so I'd either use the phone or computer to play music. This thingy has better sound | 12:05 |
@iglesiasg | and what about that feeling to control the volume with the voice from another room :D | 12:06 |
geektoni | ahah, I agree. It makes you feel powerful ;) | 12:06 |
@iglesiasg | it's cool ^_^ | 12:07 |
@iglesiasg | but yeah, at least for the use I make of it, it is a fancy toy | 12:08 |
geektoni | btw, you mean that this things provides a higher bitrate? :P | 12:08 |
geektoni | I mean, for the songs. | 12:08 |
@iglesiasg | oh, I meant the speaker is better than the on in a phone or laptop | 12:09 |
@iglesiasg | which I find reasonable | 12:10 |
@iglesiasg | https://images-na.ssl-images-amazon.com/images/I/41-v1fozy0L.jpg | 12:10 |
@iglesiasg | it has more surface for the speaker (I am assuming all the dotted part is speaker) | 12:11 |
geektoni | Oh, ok! It make sense now LOL | 12:11 |
@iglesiasg | maybe it is the bitrate, no idea | 12:11 |
@iglesiasg | just a qualitative measure; the sound is good | 12:11 |
geektoni | yeah, if the sound is good, I don't care about technical details ;) | 12:12 |
leagoetz | (iglesiasg: just making up for my bad conscience of being absent myself ;P) | 12:13 |
@iglesiasg | hihi | 12:14 |
-!- leagoetz [~leagoetz@host-92-0-178-129.as43234.net] has quit [Remote host closed the connection] | 12:17 | |
-!- leagoetz [~leagoetz@host-92-0-178-129.as43234.net] has joined #shogun | 12:17 | |
-!- leagoetz [~leagoetz@host-92-0-178-129.as43234.net] has quit [Ping timeout: 246 seconds] | 12:22 | |
-!- geektoni [~geektoni@93-34-234-212.ip52.fastwebnet.it] has quit [Quit: Leaving.] | 13:00 | |
lisitsyn | wiking: remember we were talking about storing models in protobuf | 13:00 |
lisitsyn | it is kinda ridiculous feeling when you *know* what to do but fail to execute | 13:01 |
lisitsyn | haha | 13:01 |
@wiking | que? | 13:36 |
@wiking | what do you mean lisitsyn ? :) | 13:36 |
lisitsyn | wiking: apple ml stuff | 13:36 |
@wiking | aaaah | 13:36 |
@wiking | yeah | 13:37 |
@wiking | :) | 13:37 |
@wiking | fuck i mean | 13:37 |
@wiking | they have the $ | 13:37 |
@wiking | lisitsyn, what do we do with m_parameters->add_vector ? :) | 13:47 |
lisitsyn | wiking: tough | 14:33 |
lisitsyn | or? | 14:33 |
lisitsyn | is it really different | 14:33 |
-!- geektoni [~geektoni@93-34-234-212.ip52.fastwebnet.it] has joined #shogun | 14:55 | |
geektoni | ping wiking | 14:57 |
mikeling | lisitsyn: hi | 14:59 |
lisitsyn | hey | 14:59 |
mikeling | std::vector::operator[] return reference right? | 15:00 |
mikeling | why I got binding ‘const value_type {aka const int}’ to reference of type ‘std::vector<int, std::allocator<int> >::reference {aka int&}’ discards qualifiers return m_array.at(idx1 + dim1_size * (idx2 + dim2_size * idx3)); for https://pastebin.mozilla.org/9023915 | 15:01 |
lisitsyn | discards qualifiers hints for const | 15:04 |
@iglesiasg | inderdaad | 15:04 |
mikeling | lisitsyn: mmm, I still don't understand why | 15:06 |
mikeling | because [] can return const_reference also | 15:07 |
lisitsyn | what's m_array? | 15:07 |
mikeling | lisitsyn: https://github.com/shogun-toolbox/shogun/blob/develop/src/shogun/lib/DynamicArray.h#L647 | 15:07 |
mikeling | going to refactor it by stl vector | 15:08 |
lisitsyn | I think at returns a value for you | 15:10 |
lisitsyn | const value_type {aka const int} | 15:10 |
mikeling | yeah, but why it returns int rather than int&, std::vector::operator[] do return reference as described on document | 15:11 |
@iglesiasg | lisitsyn, mikeling: by the way, I also wonder why the signature is 'inline const typename std::vector<T>::reference get_element' instead of just 'inline const T& get_element' | 15:12 |
mikeling | iglesiasg: oh, because vector can't return reference of bool element | 15:12 |
@iglesiasg | ah! | 15:13 |
lisitsyn | yeah because vector<bool> is fked | 15:13 |
lisitsyn | the worst thing happened to vector | 15:13 |
@iglesiasg | bitset is the way to go | 15:13 |
mikeling | iglesiasg: yeah, but bitset require a a fixed size to init it. But we want Dynamic array for DynamicArray | 15:14 |
@iglesiasg | mikeling: I see, it makes sense | 15:16 |
@iglesiasg | mikeling: let's see, does vector has a ::const_reference similar to the ::reference you are using above? | 15:18 |
@iglesiasg | it looks like it | 15:18 |
@iglesiasg | mikeling: http://en.cppreference.com/w/cpp/container/vector | 15:19 |
@iglesiasg | mikeling: maybe that's the way to go in this case | 15:19 |
mikeling | iglesiasg: oh, ah, I believe you are right | 15:19 |
mikeling | let's do this | 15:19 |
mikeling | use const_reference | 15:19 |
mikeling | iglesiasg: thank you | 15:19 |
@iglesiasg | cool, let us know how it goes | 15:19 |
@iglesiasg | mikeling: sure, no problem | 15:20 |
mikeling | iglesiasg: lisitsyn const_reference works, but | 15:50 |
mikeling | inline T* get_array() in DynamicArray went wrong, because std::<bool> have no way to access a pointer point to its element | 15:51 |
mikeling | :( | 15:51 |
@iglesiasg | mikeling: std::vector<bool> or std::bool? | 16:09 |
mikeling | std::vector<bool> | 16:09 |
mikeling | sorry | 16:09 |
@iglesiasg | std::vector has a pointer member similar to the reference/const_reference you have been using | 16:11 |
mikeling | iglesiasg: not exactly | 16:11 |
mikeling | iglesiasg: no data() for bool | 16:11 |
mikeling | http://en.cppreference.com/w/cpp/container/vector_bool | 16:11 |
mikeling | :( I hate this | 16:11 |
@iglesiasg | mikeling: I referred to the members cited here http://en.cppreference.com/w/cpp/container/vector | 16:11 |
@iglesiasg | in the member types table, just velow reference and const_reference, pointer and const_pointer | 16:12 |
@iglesiasg | below* lol | 16:12 |
@iglesiasg | I am not sure if that could help, mentioning just in case | 16:13 |
mikeling | you mean something like std::vector<T>::const_pointer | 16:13 |
@iglesiasg | yes | 16:13 |
@iglesiasg | I am not sure if that would help in your case though to get a pointer to the data | 16:14 |
@iglesiasg | mikeling: looking at the problem from another perspective, are we using a lot of DynamicArray for bools? | 16:17 |
mikeling | not sure, I haven't check the places using DynamicArray one by one | 16:18 |
mikeling | iglesiasg: Could we just ignore get_array() when the T is bool? | 16:18 |
@iglesiasg | I am glad that you haven't done that, because it would be a bit of a loss of time | 16:18 |
mikeling | like std::vector<bool> | 16:18 |
@iglesiasg | yes, that's is sort of what I meant by saying looking at it from another perspective | 16:19 |
mikeling | we don't provide get_array() function for bool :/ | 16:19 |
@iglesiasg | if you are getting a compile error, I guess it must be because somewhere that class is being instantiated for T = bool | 16:19 |
mikeling | ye;p | 16:19 |
@iglesiasg | mikeling: does that make sense? | 16:19 |
@iglesiasg | ok | 16:19 |
mikeling | only for bool | 16:19 |
mikeling | sure | 16:19 |
@iglesiasg | have a look where that is happening | 16:19 |
mikeling | but I don't know how | 16:20 |
@iglesiasg | and see if that really needs to use a dynamic array | 16:20 |
@iglesiasg | ah, ok. Let me give it a shot, one second | 16:20 |
mikeling | ok, thank you | 16:20 |
@iglesiasg | how does the error trace look? | 16:22 |
@iglesiasg | mikeling: from $shogun_repo/src/shogun you can just do grep -r DynamicArray\<bool | 16:25 |
@iglesiasg | DynamicArray<bool> is being used in Features and structure/DynProg | 16:25 |
mikeling | iglesiasg: I found an ugly but maybe works move like &(*(m_array.begin())); | 16:26 |
@iglesiasg | btw, I recommend using ag instead of grep | 16:26 |
mikeling | I'm building it and hope it can works this time | 16:26 |
@iglesiasg | oeps, nasty | 16:26 |
mikeling | iglesiasg: ok, &(*(m_array.begin())); doesn't work | 16:52 |
mikeling | actually | 16:52 |
-!- OXPHOS [92bd305b@gateway/web/freenode/ip.146.189.48.91] has joined #shogun | 16:56 | |
@iglesiasg | mikeling: are the places using DynamicArray<bool> getting the pointer to the data? | 17:18 |
-!- HeikoS [~heiko@host-92-0-178-129.as43234.net] has joined #shogun | 17:32 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 17:32 | |
@HeikoS | wiking: hi | 17:32 |
-!- iglesiasg [~iglesiasg@217.119.234.214] has quit [Quit: leaving] | 17:38 | |
-!- HeikoS [~heiko@host-92-0-178-129.as43234.net] has quit [Ping timeout: 246 seconds] | 18:15 | |
-!- geektoni [~geektoni@93-34-234-212.ip52.fastwebnet.it] has left #shogun [] | 18:26 | |
@wiking | mikeling, hi | 19:35 |
mikeling | wiking: | 20:13 |
mikeling | wiking: hey I thought you afk now | 20:14 |
mikeling | Because it's 2am in China now | 20:15 |
mikeling | Anyway, I found a way to return reference of vector<bool> by typename std::vector<T>::reference | 20:17 |
mikeling | But still can't figure out how to get a pointer for it | 20:17 |
mikeling | Honestly I'm pretty nervous cause I haven't make any progress for almost one week | 20:18 |
mikeling | You know I haven't send you daily report for four days due to I don't know what to write about :/ | 20:19 |
-!- olinguyen [81615ad9@gateway/web/freenode/ip.129.97.90.217] has joined #shogun | 21:10 | |
-!- mikeling [uid89706@gateway/web/irccloud.com/x-mwxnzdevzvoozsnr] has quit [Quit: Connection closed for inactivity] | 22:34 | |
--- Log closed Fri Jun 09 00:00:05 2017 |
Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!