merge GPy upstream

This commit is contained in:
Zhenwen Dai 2016-02-23 13:52:45 +00:00
commit 00e4ac152a
9 changed files with 53 additions and 312 deletions

View file

@ -61,12 +61,12 @@ class Kern(Parameterized):
self.psicomp = PSICOMP_GH()
def __setstate__(self, state):
self._all_dims_active = range(0, max(state['active_dims'])+1)
self._all_dims_active = np.arange(0, max(state['active_dims'])+1)
super(Kern, self).__setstate__(state)
@property
def _effective_input_dim(self):
return self._all_dims_active.size
return np.size(self._all_dims_active)
@Cache_this(limit=20)
def _slice_X(self, X):

View file

@ -97,7 +97,7 @@ class Stationary(Kern):
r = self._scaled_dist(X, X2)
return self.K_of_r(r)
@Cache_this(limit=20, ignore_args=())
@Cache_this(limit=3, ignore_args=())
def dK_dr_via_X(self, X, X2):
#a convenience function, so we can cache dK_dr
return self.dK_dr(self._scaled_dist(X, X2))
@ -127,7 +127,7 @@ class Stationary(Kern):
r2 = np.clip(r2, 0, np.inf)
return np.sqrt(r2)
@Cache_this(limit=20, ignore_args=())
@Cache_this(limit=3, ignore_args=())
def _scaled_dist(self, X, X2=None):
"""
Efficiently compute the scaled distance, r.