Minor edits

This commit is contained in:
James Hensman 2012-12-05 09:10:27 -08:00
parent 4dcf2b85ce
commit c003b2f34d
3 changed files with 7 additions and 3 deletions

View file

@ -37,7 +37,7 @@ class sparse_GP_regression(GP_regression):
:type normalize_(X|Y): bool
"""
def __init__(self,X,Y,kernel=None, beta=100., Z=None,Zslices=None,M=10,normalize_X=False,normalize_Y=False):
def __init__(self,X,Y,kernel=None, X_uncertainty=None, beta=100., Z=None,Zslices=None,M=10,normalize_X=False,normalize_Y=False):
self.beta = beta
if Z is None:
self.Z = np.random.permutation(X.copy())[:M]
@ -56,6 +56,10 @@ class sparse_GP_regression(GP_regression):
GP_regression.__init__(self, X, Y, kernel=kernel, normalize_X=normalize_X, normalize_Y=normalize_Y)
self.trYYT = np.sum(np.square(self.Y))
#normalise X uncertainty also
if self.has_uncertain_inputs:
self.X_uncertainty /= np.square(self._Xstd)
def set_param(self, p):
self.Z = p[:self.M*self.Q].reshape(self.M, self.Q)
self.beta = p[self.M*self.Q]

View file

@ -1,4 +1,4 @@
# Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Copyright (c) 2012 James Hensman
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np