From b94ebc2aa2f666c47f9d177ef0e3703b06daff24 Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Fri, 17 Oct 2014 17:32:51 +0100 Subject: [PATCH] [sparse GP] fallback for other inference methods for missing_data --- GPy/core/sparse_gp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GPy/core/sparse_gp.py b/GPy/core/sparse_gp.py index c83381b9..183971d1 100644 --- a/GPy/core/sparse_gp.py +++ b/GPy/core/sparse_gp.py @@ -110,7 +110,10 @@ class SparseGP(GP): like them into this dictionary for inner use of the indices inside the algorithm. """ - posterior, log_marginal_likelihood, grad_dict = self.inference_method.inference(kern, X, Z, likelihood, Y, Y_metadata, Lm=Lm, dL_dKmm=None) + try: + posterior, log_marginal_likelihood, grad_dict = self.inference_method.inference(kern, X, Z, likelihood, Y, Y_metadata, Lm=Lm, dL_dKmm=None) + except: + posterior, log_marginal_likelihood, grad_dict = self.inference_method.inference(kern, X, Z, likelihood, Y, Y_metadata) current_values = {} likelihood.update_gradients(grad_dict['dL_dthetaL']) current_values['likgrad'] = likelihood.gradient.copy()