Open in new window / Try shogun cloud
--- Log opened Sun Mar 31 00:00:18 2013
shogun-buildbotbuild #339 of nightly_default is complete: Failure [failed test]  Build details are at
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun09:59
-!- tp199911 [] has joined #shogun11:09
-!- tp199911 is now known as ZeThomas11:09
ZeThomashey I have some trouble making a custom kernel11:11
blackburnZeThomas: hey what is the problem?11:11
ZeThomasI basically have my own object types, and defined a function that gives the k(.,.) values on two of those11:12
ZeThomasI am able to then make a shogun kernel by subclassing one, and populating the matrix myself11:12
blackburnare you using python btw?11:13
ZeThomasbut I am now at loss as to how I would use apply() on my SVM(Light), since it asks for a feature object11:13
ZeThomasyes, modshogun11:13
blackburnthere is a feature of swig called directors11:13
blackburnbasically you define your own kernel11:14
blackburnand shogun uses your python code to compute values11: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
ZeThomasoh, ok, how do I do this exactly then?11:15
blackburnZeThomas: first 1) configure with --enable-swig-directors11:16
blackburnZeThomas: most interesting for you is class at line 1511:17
ZeThomasblackburn: so I recompile11:18
blackburnZeThomas: yes11:18
blackburnZeThomas: so you don't use shogun features to store the data right?11:18
ZeThomasno, indeed11:19
blackburnZeThomas: alright then everything would look like in that example11:20
blackburnexcept lines 19 and 2011:20
blackburnZeThomas: so you define a class that implements def kernel_function(self, idx_a, idx_b):11:21
ZeThomasso after the recompile, I get a class named DirectorKernel that I subclass?11:21
blackburnZeThomas: exactly11:21
blackburnZeThomas: if you pass that class as kernel to svmlight11:21
blackburnit will call the code you write11:21
ZeThomasand how do I train/test?11:22
blackburnZeThomas: well you may add any methods you'd need to handle that11:23
blackburnZeThomas: you may also use DummyFeatures(N)11:23
blackburnwhere N is the number of vectors11:23
blackburnZeThomas: so the workflow would be11:24
blackburn1) set data on your kernel and init the kernel with kernel.init(DummyFeatures(n_train_vectors),DummyFeatures(n_train_vectors))11:25
blackburn2) train the machine11:25
-!- lambday [3ba2174d@gateway/web/freenode/ip.] has joined #shogun11:26
blackburn3) set your kernel for testing somehow and call kernel.init(DummyFeatures(n_train_vectors),DummyFeatures(n_test_vectors))11:26
-!- ZeThomas [] has quit [Ping timeout: 252 seconds]11:31
-!- sumit [73f91219@gateway/web/freenode/ip.] has joined #shogun11:34
-!- ZeThomas [] has joined #shogun11:37
ZeThomashey sorry, I got disconnected11:38
ZeThomasok, wait, I'm still a bit confused; do I manually provide the (upper) Gram matrix?11:38
ZeThomasand 2) (how) do I call apply() on my svm, and can I still extract the values from the result (get_values())?11:38
blackburnZeThomas: yes everything related to svm stays the same11:38
blackburnZeThomas: about first q - you do provide a function that computes k(idx_a,idx_b)11:39
blackburnwhere idx_a and idx_b are in [0,n_train_vectors] when training11:39
blackburnand idx_b is in [0,n_test_vectors] when testing11:39
-!- ZeThomas [] has quit [Ping timeout: 245 seconds]11:44
lambdayblackburn: hi..12:09
blackburnlambday: hey12:09
lambdayI was was writing a unit test for sparse matrix cholesky factorization... what could be a good test case?12:09
blackburnlambday: well you may check if after factorization L*LT is still the original matrix12:11
lambdayblackburn: umm... yes12:11
lambdaywell, actually it permutes the original matrix before factorization so that it results in sparser factors...12:12
lambdayso, P -1 * L * LT * P will give original matrix12:12
blackburnlambday: yeah or that12:13
lambdayblackburn: hmm .. thanks.. :)12:14
-!- sumit [73f91219@gateway/web/freenode/ip.] has quit [Ping timeout: 245 seconds]14:21
-!- lambday [3ba2174d@gateway/web/freenode/ip.] has quit []17:03
-!- sumit [73f91219@gateway/web/freenode/ip.] has joined #shogun17:26
-!- cwidmer [0447bed4@gateway/web/freenode/ip.] has joined #shogun21:25
-!- lambday [b613104d@gateway/web/freenode/ip.] has joined #shogun21:45
-!- lambday [b613104d@gateway/web/freenode/ip.] has quit [Client Quit]21:49
-!- sumit [73f91219@gateway/web/freenode/ip.] has quit [Quit: Page closed]22:48
-!- cwidmer [0447bed4@gateway/web/freenode/ip.] has quit [Quit: Page closed]23:05
--- Log closed Mon Apr 01 00:00:18 2013