Skip to content

Commit

Permalink
Fix subtle bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wesselb committed Oct 22, 2022
1 parent 0828aa5 commit 70377f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stheno/model/observations.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ def _compute(self, measure):
f'not "{type(K_n).__name__}".'
)

# Precompute commonly used quantities.
L_z = B.cholesky(K_z)
iLz_Kzx = B.solve(L_z, K_zx)
A = B.add(B.eye(K_z), B.iqf(K_n, B.transpose(iLz_Kzx)))

if self.method in {"vfe", "fitc"}:
K_x_diag = measure.kernels[p_x].elwise(x)[..., 0]
Expand All @@ -318,6 +318,7 @@ def _compute(self, measure):
raise ValueError(f'Invalid approximation method "{method}".')

# Subspace variance:
A = B.add(B.eye(K_z), B.iqf(K_n, B.transpose(iLz_Kzx)))
self._A[id(measure)] = B.mm(L_z, A, L_z, tr_c=True)

# Optimal mean:
Expand Down

0 comments on commit 70377f0

Please sign in to comment.