mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-29 15:59:41 +02:00
xrange fixes for Python 3
This commit is contained in:
parent
5eeb2f18e9
commit
cf1c382acd
14 changed files with 29 additions and 29 deletions
|
|
@ -107,7 +107,7 @@ class Posterior(object):
|
|||
if self._precision is None:
|
||||
cov = np.atleast_3d(self.covariance)
|
||||
self._precision = np.zeros(cov.shape) # if one covariance per dimension
|
||||
for p in xrange(cov.shape[-1]):
|
||||
for p in range(cov.shape[-1]):
|
||||
self._precision[:,:,p] = pdinv(cov[:,:,p])[0]
|
||||
return self._precision
|
||||
|
||||
|
|
@ -125,7 +125,7 @@ class Posterior(object):
|
|||
if self._woodbury_inv is not None:
|
||||
winv = np.atleast_3d(self._woodbury_inv)
|
||||
self._woodbury_chol = np.zeros(winv.shape)
|
||||
for p in xrange(winv.shape[-1]):
|
||||
for p in range(winv.shape[-1]):
|
||||
self._woodbury_chol[:,:,p] = pdinv(winv[:,:,p])[2]
|
||||
#Li = jitchol(self._woodbury_inv)
|
||||
#self._woodbury_chol, _ = dtrtri(Li)
|
||||
|
|
@ -160,7 +160,7 @@ class Posterior(object):
|
|||
elif self._covariance is not None:
|
||||
B = np.atleast_3d(self._K) - np.atleast_3d(self._covariance)
|
||||
self._woodbury_inv = np.empty_like(B)
|
||||
for i in xrange(B.shape[-1]):
|
||||
for i in range(B.shape[-1]):
|
||||
tmp, _ = dpotrs(self.K_chol, B[:,:,i])
|
||||
self._woodbury_inv[:,:,i], _ = dpotrs(self.K_chol, tmp.T)
|
||||
return self._woodbury_inv
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class VarDTC_minibatch(LatentFunctionInference):
|
|||
psi0_full = 0.
|
||||
YRY_full = 0.
|
||||
|
||||
for n_start in xrange(0,num_data,batchsize):
|
||||
for n_start in range(0,num_data,batchsize):
|
||||
n_end = min(batchsize+n_start, num_data)
|
||||
if batchsize==num_data:
|
||||
Y_slice = Y
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue