From f46c72b79b752def2883143bcb90e1cb0394f0ee Mon Sep 17 00:00:00 2001 From: Neil Lawrence Date: Tue, 19 Nov 2013 06:50:25 +0000 Subject: [PATCH] Bug fix for single output sympy kernel. --- GPy/kern/parts/__init__.py | 2 +- GPy/kern/parts/sympykern.py | 15 +++++++++++---- GPy/util/datasets.py | 15 +++++++++++++-- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/GPy/kern/parts/__init__.py b/GPy/kern/parts/__init__.py index d8e7f8e6..f278941a 100644 --- a/GPy/kern/parts/__init__.py +++ b/GPy/kern/parts/__init__.py @@ -14,7 +14,7 @@ import Matern32 import Matern52 import mlp import ODE_1 -import ODE_UY +#import ODE_UY import periodic_exponential import periodic_Matern32 import periodic_Matern52 diff --git a/GPy/kern/parts/sympykern.py b/GPy/kern/parts/sympykern.py index 88c179aa..7f7fba11 100644 --- a/GPy/kern/parts/sympykern.py +++ b/GPy/kern/parts/sympykern.py @@ -177,8 +177,15 @@ class spkern(Kernpart): # Code to compute argument string when only diagonal is required. diag_arg_string = re.sub('int jj','//int jj',X_arg_string) diag_arg_string = re.sub('j','i',diag_arg_string) - diag_precompute_string = precompute_list[0] - + if precompute_string == '': + # if it's not multioutput, the precompute strings are set to zero + diag_precompute_string = '' + diag_precompute_replace = '' + else: + # for multioutput we need to extract the index of the output form the input. + diag_precompute_string = precompute_list[0] + diag_precompute_replace = precompute_list[1] + # Here's the code to do the looping for K self._K_code =\ @@ -215,13 +222,13 @@ class spkern(Kernpart): TARGET2(i, i) += k(%s); for (j=0;j