Skip to content

Commit

Permalink
better sparse logdet() 4
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusMNoack committed Dec 15, 2022
1 parent 9c4ce2d commit 1587098
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fvgp/sparse_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ def random_logdet(self, A,eps = 0.50, delta = 0.01,m = 100):
for i in range(p):
g = np.random.normal(0, 1., size = N)
v = C @ g
gamma[i,1] = g.T @ v
gamma[i,0] = g.T @ v
for k in range(1,m):
v = C @ v
gamma[i,k] = g.T @ v
s = np.sum(gamma, axis = 0) / float(p)
s = s[1:] / np.arange(1,len(s))
s = s / np.arange(1,len(s)+1)
return N * np.log(alpha) - np.sum(s)

0 comments on commit 1587098

Please sign in to comment.