From d83e911fe228571171f9ddc379708dc37c4bfddf Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Tue, 27 Mar 2018 19:24:03 +0100 Subject: Major bugfix for nonlinear GenSVM Nonlinear GenSVM depends on the eigendecomposition of the kernel matrix. Mathematically, the Sigma vector in the code should contain the square root of the eigenvalues. Taking the square root was however neglected, which resulted in poor performance of nonlinear GenSVM. This is now fixed, which means that the performance of nonlinear GenSVM will be much better. --- src/gensvm_kernel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gensvm_kernel.c b/src/gensvm_kernel.c index 521bddb..190a120 100644 --- a/src/gensvm_kernel.c +++ b/src/gensvm_kernel.c @@ -264,9 +264,12 @@ long gensvm_kernel_eigendecomp(double *K, long n, double cutoff, double **P_ret, num_eigen = n - cutoff_idx; + // In the mathematical derivation (see paper), we state that the + // diagonal matrix Sigma contains the square root of the eigenvalues + // (i.e. the eigendecomposition is: K = P * Sigma^2 * P'). Sigma = Calloc(double, num_eigen); for (i=0; i