mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-08 15:05:15 +02:00
Added svgp in partially broken state ready for multiouputs
This commit is contained in:
parent
935f2016db
commit
7ba2e2ed08
1 changed files with 8 additions and 7 deletions
|
|
@ -10,15 +10,16 @@ class SVGP(LatentFunctionInference):
|
|||
|
||||
num_inducing = Z.shape[0]
|
||||
#expand cholesky representation
|
||||
L = choleskies.flat_to_triang(q_u_chol[:,None]).squeeze()
|
||||
S = L.dot(L.T)
|
||||
Si,_ = linalg.dpotri(np.asfortranarray(L), lower=1)
|
||||
logdetS = 2.*np.sum(np.log(np.abs(np.diag(L))))
|
||||
L = choleskies.flat_to_triang(q_u_chol)
|
||||
S = np.einsum('ijk,ljk->ilk', L, L) #L.dot(L.T)
|
||||
#Si,_ = linalg.dpotri(np.asfortranarray(L), lower=1)
|
||||
Si = choleskies.multiple_dpotri(L)
|
||||
logdetS = np.array([2.*np.sum(np.log(np.abs(np.diag(L[:,:,i])))) for i in range(L.shape[-1])])
|
||||
|
||||
if np.any(np.isinf(Si)):
|
||||
print "warning:Cholesky representation unstable"
|
||||
S = S + np.eye(S.shape[0])*1e-5*np.max(np.max(S))
|
||||
Si, Lnew, _,_ = linalg.pdinv(S)
|
||||
raise ValueError("Cholesky representation unstable")
|
||||
#S = S + np.eye(S.shape[0])*1e-5*np.max(np.max(S))
|
||||
#Si, Lnew, _,_ = linalg.pdinv(S)
|
||||
|
||||
#compute kernel related stuff
|
||||
Kmm = kern.K(Z)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue