From be8417315c9e141ee664bf86e8c8a53126628d04 Mon Sep 17 00:00:00 2001 From: Nicolo Fusi Date: Thu, 31 Jan 2013 13:38:05 +0000 Subject: [PATCH] minor changes --- GPy/inference/SGD.py | 4 ++-- GPy/models/sparse_GP_regression.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/GPy/inference/SGD.py b/GPy/inference/SGD.py index 79ddf605..25f9feae 100644 --- a/GPy/inference/SGD.py +++ b/GPy/inference/SGD.py @@ -132,7 +132,6 @@ class opt_SGD(Optimizer): self.model.Y = self.model.Y[samples] model_name = self.model.__class__.__name__ - import pdb; pdb.set_trace() if model_name == 'Bayesian_GPLVM': self.model.trYYT = np.sum(np.square(self.model.Y)) @@ -159,6 +158,7 @@ class opt_SGD(Optimizer): self.trace = [] missing_data = self.check_for_missing(self.model.Y) self.model.Youter = None # this is probably not very efficient + self.model.YYT = None for it in range(self.iterations): if it == 0 or self.self_paced is False: @@ -176,7 +176,7 @@ class opt_SGD(Optimizer): count += 1 self.model.D = len(j) self.model.Y = Y[:, j] - + self.model.trYYT = np.sum(np.square(self.model.Y)) if missing_data: shapes = self.get_param_shapes(N, Q) f, step, Nj = self.step_with_missing_data(f_fp, X, Y, step, shapes) diff --git a/GPy/models/sparse_GP_regression.py b/GPy/models/sparse_GP_regression.py index fc8a9014..6b958dae 100644 --- a/GPy/models/sparse_GP_regression.py +++ b/GPy/models/sparse_GP_regression.py @@ -120,7 +120,7 @@ class sparse_GP_regression(GP_regression): def _get_param_names(self): return sum([['iip_%i_%i'%(i,j) for i in range(self.Z.shape[0])] for j in range(self.Z.shape[1])],[]) + ['noise_precision']+self.kern._get_param_names_transformed() - + def log_likelihood(self): """ Compute the (lower bound on the) log marginal likelihood """ sf2 = self.scale_factor**2 @@ -132,7 +132,7 @@ class sparse_GP_regression(GP_regression): def _log_likelihood_gradients(self): return np.hstack([self.dL_dZ().flatten(), self.dL_dbeta(), self.dL_dtheta()]) - + def dL_dbeta(self): """ Compute the gradient of the log likelihood wrt beta.