--- Log opened Sun Mar 31 00:00:18 2013 | ||
shogun-buildbot | build #339 of nightly_default is complete: Failure [failed test] Build details are at http://www.shogun-toolbox.org/buildbot/builders/nightly_default/builds/339 | 03:39 |
---|---|---|
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun | 09:59 | |
-!- tp199911 [~thomas@cust-122-150-108-94.dyn.as47377.net] has joined #shogun | 11:09 | |
-!- tp199911 is now known as ZeThomas | 11:09 | |
ZeThomas | hey I have some trouble making a custom kernel | 11:11 |
blackburn | ZeThomas: hey what is the problem? | 11:11 |
ZeThomas | I basically have my own object types, and defined a function that gives the k(.,.) values on two of those | 11:12 |
blackburn | alright | 11:12 |
ZeThomas | I am able to then make a shogun kernel by subclassing one, and populating the matrix myself | 11:12 |
blackburn | are you using python btw? | 11:13 |
ZeThomas | but I am now at loss as to how I would use apply() on my SVM(Light), since it asks for a feature object | 11:13 |
ZeThomas | yes, modshogun | 11:13 |
blackburn | there is a feature of swig called directors | 11:13 |
blackburn | basically you define your own kernel | 11:14 |
blackburn | and shogun uses your python code to compute values | 11:14 |
blackburn | (it would be good if you wouldn't like to populate whole matrix) | 11:14 |
ZeThomas | (i only populate upper triangle ofcourse :) ) | 11:15 |
ZeThomas | oh, ok, how do I do this exactly then? | 11:15 |
blackburn | ZeThomas: first 1) configure with --enable-swig-directors | 11:16 |
blackburn | 2) https://github.com/shogun-toolbox/shogun/blob/master/examples/undocumented/python_modular/kernel_director_linear_modular.py | 11:17 |
blackburn | ZeThomas: most interesting for you is class at line 15 | 11:17 |
ZeThomas | blackburn: so I recompile | 11:18 |
ZeThomas | ? | 11:18 |
blackburn | ZeThomas: yes | 11:18 |
blackburn | ZeThomas: so you don't use shogun features to store the data right? | 11:18 |
ZeThomas | no, indeed | 11:19 |
blackburn | ZeThomas: alright then everything would look like in that example | 11:20 |
blackburn | except lines 19 and 20 | 11:20 |
blackburn | ZeThomas: so you define a class that implements def kernel_function(self, idx_a, idx_b): | 11:21 |
ZeThomas | so after the recompile, I get a class named DirectorKernel that I subclass? | 11:21 |
blackburn | ZeThomas: exactly | 11:21 |
blackburn | ZeThomas: if you pass that class as kernel to svmlight | 11:21 |
blackburn | it will call the code you write | 11:21 |
ZeThomas | and how do I train/test? | 11:22 |
blackburn | ZeThomas: well you may add any methods you'd need to handle that | 11:23 |
blackburn | ZeThomas: you may also use DummyFeatures(N) | 11:23 |
blackburn | where N is the number of vectors | 11:23 |
blackburn | ZeThomas: so the workflow would be | 11:24 |
blackburn | 1) set data on your kernel and init the kernel with kernel.init(DummyFeatures(n_train_vectors),DummyFeatures(n_train_vectors)) | 11:25 |
blackburn | 2) train the machine | 11:25 |
-!- lambday [3ba2174d@gateway/web/freenode/ip.59.162.23.77] has joined #shogun | 11:26 | |
blackburn | 3) set your kernel for testing somehow and call kernel.init(DummyFeatures(n_train_vectors),DummyFeatures(n_test_vectors)) | 11:26 |
-!- ZeThomas [~thomas@cust-122-150-108-94.dyn.as47377.net] has quit [Ping timeout: 252 seconds] | 11:31 | |
-!- sumit [73f91219@gateway/web/freenode/ip.115.249.18.25] has joined #shogun | 11:34 | |
-!- ZeThomas [~thomas@cust-190-150-108-94.dyn.as47377.net] has joined #shogun | 11:37 | |
ZeThomas | hey sorry, I got disconnected | 11:38 |
ZeThomas | ok, wait, I'm still a bit confused; do I manually provide the (upper) Gram matrix? | 11:38 |
ZeThomas | and 2) (how) do I call apply() on my svm, and can I still extract the values from the result (get_values())? | 11:38 |
blackburn | ZeThomas: yes everything related to svm stays the same | 11:38 |
blackburn | ZeThomas: about first q - you do provide a function that computes k(idx_a,idx_b) | 11:39 |
blackburn | where idx_a and idx_b are in [0,n_train_vectors] when training | 11:39 |
blackburn | and idx_b is in [0,n_test_vectors] when testing | 11:39 |
-!- ZeThomas [~thomas@cust-190-150-108-94.dyn.as47377.net] has quit [Ping timeout: 245 seconds] | 11:44 | |
lambday | blackburn: hi.. | 12:09 |
blackburn | lambday: hey | 12:09 |
lambday | I was was writing a unit test for sparse matrix cholesky factorization... what could be a good test case? | 12:09 |
blackburn | lambday: well you may check if after factorization L*LT is still the original matrix | 12:11 |
lambday | blackburn: umm... yes | 12:11 |
lambday | well, actually it permutes the original matrix before factorization so that it results in sparser factors... | 12:12 |
lambday | so, P -1 * L * LT * P will give original matrix | 12:12 |
blackburn | lambday: yeah or that | 12:13 |
lambday | blackburn: hmm .. thanks.. :) | 12:14 |
-!- sumit [73f91219@gateway/web/freenode/ip.115.249.18.25] has quit [Ping timeout: 245 seconds] | 14:21 | |
-!- lambday [3ba2174d@gateway/web/freenode/ip.59.162.23.77] has quit [] | 17:03 | |
-!- sumit [73f91219@gateway/web/freenode/ip.115.249.18.25] has joined #shogun | 17:26 | |
-!- cwidmer [0447bed4@gateway/web/freenode/ip.4.71.190.212] has joined #shogun | 21:25 | |
-!- lambday [b613104d@gateway/web/freenode/ip.182.19.16.77] has joined #shogun | 21:45 | |
-!- lambday [b613104d@gateway/web/freenode/ip.182.19.16.77] has quit [Client Quit] | 21:49 | |
-!- sumit [73f91219@gateway/web/freenode/ip.115.249.18.25] has quit [Quit: Page closed] | 22:48 | |
-!- cwidmer [0447bed4@gateway/web/freenode/ip.4.71.190.212] has quit [Quit: Page closed] | 23:05 | |
--- Log closed Mon Apr 01 00:00:18 2013 |
Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!