Skip to content

Commit

Permalink
better sparse logdet()
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusMNoack committed Dec 15, 2022
1 parent ba5f9ed commit 051e24a
Show file tree
Hide file tree
Showing 3 changed files with 529 additions and 5 deletions.
5 changes: 3 additions & 2 deletions fvgp/gp.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,9 @@ def log_likelihood(self,hyperparameters):
y = self.y_data - mean
sign, logdet = self.slogdet(K)
n = len(y)
if sign == 0.0: return (0.5 * (y.T @ x)) + (0.5 * n * np.log(2.0*np.pi))
return (0.5 * (y.T @ x)) + (0.5 * sign * logdet) + (0.5 * n * np.log(2.0*np.pi))
#if sign == 0.0: return (0.5 * (y.T @ x)) + (0.5 * n * np.log(2.0*np.pi))
#return (0.5 * (y.T @ x)) + (0.5 * sign * logdet) + (0.5 * n * np.log(2.0*np.pi))
return (0.5 * (y.T @ x)) + (0.5 * logdet) + (0.5 * n * np.log(2.0*np.pi))
##################################################################################
def log_likelihood_gradient(self, hyperparameters):
"""
Expand Down

0 comments on commit 051e24a

Please sign in to comment.