--- Log opened Sat Jan 26 00:00:44 2019 | ||
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun | 01:02 | |
-!- mode/#shogun [+o wiking] by ChanServ | 01:02 | |
-!- wiking [~wiking@huwico/staff/wiking] has quit [Ping timeout: 240 seconds] | 01:06 | |
-!- tangy [491d7f98@gateway/web/freenode/ip.73.29.127.152] has joined #shogun | 06:18 | |
-!- tangy [491d7f98@gateway/web/freenode/ip.73.29.127.152] has quit [Client Quit] | 06:19 | |
-!- shubham808 [~atom@14.139.240.247] has joined #shogun | 08:02 | |
-!- gf712 [560fc4e5@gateway/web/freenode/ip.86.15.196.229] has joined #shogun | 12:52 | |
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun | 13:22 | |
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has quit [Changing host] | 13:22 | |
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun | 13:22 | |
-!- mode/#shogun [+o wiking] by ChanServ | 13:22 | |
-!- wiking [~wiking@huwico/staff/wiking] has quit [Remote host closed the connection] | 13:26 | |
-!- shubham808 [~atom@14.139.240.247] has quit [Ping timeout: 245 seconds] | 13:42 | |
-!- gf712 [560fc4e5@gateway/web/freenode/ip.86.15.196.229] has quit [Ping timeout: 256 seconds] | 13:49 | |
-!- shubham808 [~atom@14.139.240.247] has joined #shogun | 13:57 | |
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun | 15:27 | |
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has quit [Changing host] | 15:27 | |
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun | 15:27 | |
-!- mode/#shogun [+o wiking] by ChanServ | 15:27 | |
-!- wiking [~wiking@huwico/staff/wiking] has quit [Ping timeout: 268 seconds] | 15:32 | |
-!- shubham808 [~atom@14.139.240.247] has quit [Ping timeout: 272 seconds] | 17:16 | |
-!- HeikoS [5aae0442@gateway/web/cgi-irc/kiwiirc.com/ip.90.174.4.66] has joined #shogun | 18:01 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 18:01 | |
@HeikoS | lisitsyn yo | 18:01 |
---|---|---|
@HeikoS | wuwei[m] yo | 18:13 |
wuwei[m] | HeikoS: hey | 18:14 |
@HeikoS | wuwei[m] cool that the example now works! | 18:14 |
wuwei[m] | yeah | 18:14 |
@HeikoS | what do you think about the api necessary? | 18:14 |
@HeikoS | and the fact that we cannot change the machine using put de-facto | 18:14 |
@HeikoS | at least from swig | 18:14 |
@HeikoS | in c++ people can do it if they want | 18:14 |
wuwei[m] | in c++ they can call put<CMachine*> | 18:15 |
wuwei[m] | but meta examples do work now | 18:15 |
wuwei[m] | for c++ | 18:15 |
@HeikoS | yes | 18:16 |
wuwei[m] | is it possible to somehow hack the meta geneator? | 18:16 |
@HeikoS | yes but let's not do that | 18:16 |
@HeikoS | another solution I could imagine is to offer an "as_machine" | 18:16 |
@HeikoS | eval.put("machine", pipeline.as_machine()) | 18:17 |
wuwei[m] | yes this should work | 18:17 |
@HeikoS | is that better than the argument? | 18:17 |
@HeikoS | what do you think? | 18:17 |
wuwei[m] | I feel as_machine is better | 18:19 |
wuwei[m] | because we have pipeline as a base type | 18:19 |
wuwei[m] | so users can cast it to machine | 18:19 |
wuwei[m] | btw in meta, we will have Machine variable to save the intermediate result | 18:20 |
wuwei[m] | Machine m = eval.as_machine() | 18:20 |
wuwei[m] | i mean, Machine m = pipeline.as_machine() | 18:21 |
wuwei[m] | and then eval.put | 18:21 |
@HeikoS | wuwei[m] true | 18:33 |
@HeikoS | you wanna try adding that? But also keep the old code please so we can discuss and then decide | 18:33 |
wuwei[m] | sure | 18:34 |
@HeikoS | if you want | 18:34 |
@HeikoS | we can actually add something to the meta generator, a very small change | 18:34 |
@HeikoS | so in the meta example we can write | 18:34 |
@HeikoS | obj.put_machine("foo", bar) | 18:34 |
@HeikoS | and then we can add a line | 18:35 |
@HeikoS | in python.cpp | 18:35 |
@HeikoS | under MethodCall | 18:35 |
@HeikoS | that is | 18:35 |
@HeikoS | ah no it doesnt work | 18:35 |
@HeikoS | crap sorry .) | 18:35 |
@HeikoS | Ok I think then we just add an "as_machine" in the swig code | 18:36 |
wuwei[m] | why it doesnt work | 18:36 |
@HeikoS | because | 18:36 |
@HeikoS | "put_machine": "$object.put($arguments)" | 18:37 |
@HeikoS | we cannot "insert" as_machine | 18:37 |
@HeikoS | as the arguments are only accessible as a group | 18:37 |
wuwei[m] | i see | 18:37 |
@HeikoS | I mean we can change this later | 18:37 |
@HeikoS | but for now, why not explicitly do it? | 18:37 |
@HeikoS | "as_machine": "$object.as_machine($arguments)" | 18:38 |
@HeikoS | in python | 18:38 |
@HeikoS | and in cpp.json, we would have | 18:38 |
@HeikoS | "put_machine": "$object->put<CMachine>($arguments)" | 18:38 |
@HeikoS | then we only need to add "as_machine" cast to the swig interface code, not libshogun | 18:39 |
@HeikoS | would this work? | 18:39 |
wuwei[m] | cool | 18:39 |
@HeikoS | wuwei[m] then we need to touch the json dictionaries every time we need such upcasting | 18:40 |
@HeikoS | which kinda sucks | 18:40 |
@HeikoS | but it only happens for shogun base classes that inherit from each other, so there is only a limited number | 18:40 |
wuwei[m] | but pipeline is the only exception now? | 18:40 |
@HeikoS | on the other hand, the method you implemented in the PR does not require any modification of the dictionaries | 18:40 |
@HeikoS | yes seems like | 18:41 |
@HeikoS | let's try it then | 18:41 |
@HeikoS | we can hack the meta lang later to access the arguments when replacing method calls | 18:41 |
wuwei[m] | yes that's possible | 18:42 |
wuwei[m] | in python "as_machine": "$object.as_machine($arguments)", do we still need as_machine in libshogun? | 18:43 |
@HeikoS | https://github.com/shogun-toolbox/shogun/issues/4490 | 18:45 |
@HeikoS | wuwei[m] no as_machine needed in libshogun | 18:45 |
@HeikoS | we would either just use obj->as<CMachine> | 18:45 |
@HeikoS | but we do not even need that if we use a templated put | 18:46 |
@HeikoS | obj->put<CMachine>("bla", pipeline=) | 18:46 |
@HeikoS | that works | 18:46 |
@HeikoS | so you can already do | 18:46 |
@HeikoS | "put_machine": "$object->put<CMachine>($arguments)" | 18:46 |
@HeikoS | wuwei[m] I suggest the following | 18:47 |
@HeikoS | for now, you add the "as_machine" in swig, and then change the meta example to use it explicitly and store the casted variable before putting it | 18:47 |
@HeikoS | and then once esben has hacked the meta generator, we can change it to put_machine | 18:47 |
@HeikoS | wuwei[m] good? | 18:47 |
wuwei[m] | how python works? | 18:48 |
@HeikoS | what do you mean? | 18:48 |
wuwei[m] | do we need put pipeline in swig? | 18:48 |
wuwei[m] | eval.put("machine", pipeline) | 18:48 |
@HeikoS | well yes if there is no factory | 18:49 |
@HeikoS | that has the CMachine argument | 18:49 |
@HeikoS | and our current pattern kinda of is to only construct objects that are "empty" | 18:50 |
wuwei[m] | so we will add "as_machine" and put pipeline in swig? | 18:52 |
@HeikoS | what do you mean with "put pipeline in swig?"? | 18:53 |
wuwei[m] | the other option we talked about before | 18:55 |
wuwei[m] | some special handling when pipeline is used in put | 18:56 |
@HeikoS | ah | 19:01 |
@HeikoS | yeah let's not that | 19:01 |
@HeikoS | I think the best candidates is either what you have done in the PR | 19:01 |
@HeikoS | or the "as_machine" in swig c++ code | 19:01 |
wuwei[m] | my question is what's as_machine in python | 19:02 |
@HeikoS | you have to add it | 19:04 |
@HeikoS | in shogun.oi | 19:04 |
@HeikoS | shogun.i | 19:04 |
@HeikoS | there you can write c++ code that is added to the python interface | 19:05 |
wuwei[m] | ah i see | 19:05 |
wuwei[m] | lets do this | 19:05 |
@HeikoS | CMachine* CPipeline::as_machine() | 19:05 |
@HeikoS | you can even only add it to CPipeline as that is exposed to swig anyways | 19:05 |
@HeikoS | and then swig generates the python call | 19:05 |
wuwei[m] | cool, will try it | 19:06 |
@HeikoS | nice | 19:07 |
@HeikoS | as said, keep this code so we could go back if needed | 19:07 |
@HeikoS | ok I am off, thanks wuwei[m] ! | 19:10 |
wuwei[m] | see you later | 19:11 |
@HeikoS | wuwei[m] one thing | 19:16 |
@HeikoS | wuwei[m] you can actually just pass the pipeline object to "machine" | 19:16 |
@HeikoS | no need to add "as_machine" | 19:16 |
@HeikoS | just to | 19:16 |
@HeikoS | eval.put("machine", machine(pipeline)) | 19:17 |
@HeikoS | wuwei[m] see what I mean? | 19:17 |
wuwei[m] | i see | 19:17 |
wuwei[m] | didn't know that | 19:17 |
@HeikoS | I forgot it, but that was exactly the point :) | 19:17 |
@HeikoS | so we dont need "as_*" | 19:17 |
@HeikoS | ok I am really off now | 19:17 |
-!- HeikoS [5aae0442@gateway/web/cgi-irc/kiwiirc.com/ip.90.174.4.66] has quit [Ping timeout: 246 seconds] | 19:22 | |
-!- shubham808 [~atom@14.139.240.247] has joined #shogun | 19:54 | |
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun | 20:38 | |
-!- mode/#shogun [+o wiking] by ChanServ | 20:38 | |
-!- shubham808 [~atom@14.139.240.247] has quit [Quit: Leaving.] | 21:41 | |
-!- wiking [~wiking@huwico/staff/wiking] has quit [Remote host closed the connection] | 22:19 | |
--- Log closed Sun Jan 27 00:00:45 2019 |
Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!