Skip to content

Commit

Permalink
Merge pull request #26 from fsaad/main
Browse files Browse the repository at this point in the history
BaseModel.predict needs predict=True in spatial_conditional call
  • Loading branch information
wil-j-wil authored Dec 14, 2023
2 parents b899eed + 9f07ce2 commit fad0483
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bayesnewton/basemodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ def predict(self, X=None, R=None, pseudo_lik_params=None):
H = self.kernel.measurement_model()
if self.spatio_temporal:
# TODO: if R is fixed, only compute B, C once
B, C = self.kernel.spatial_conditional(X, R)
B, C = self.kernel.spatial_conditional(X, R, predict=True)
W = B @ H
test_mean = W @ state_mean
test_var = W @ state_cov @ transpose(W) + C
Expand Down Expand Up @@ -1060,7 +1060,7 @@ def predict(self, X, R=None):
H = self.kernel.measurement_model()
if self.spatio_temporal:
# TODO: if R is fixed, only compute B, C once
B, C = self.kernel.spatial_conditional(X, R)
B, C = self.kernel.spatial_conditional(X, R, predict=True)
W = B @ H
test_mean = W @ state_mean
test_var = W @ state_cov @ transpose(W) + C
Expand Down Expand Up @@ -1216,7 +1216,7 @@ def predict(self, X=None, R=None, pseudo_lik_params=None):
H = self.kernel.measurement_model()
if self.spatio_temporal:
# TODO: if R is fixed, only compute B, C once
B, C = self.kernel.spatial_conditional(X, R)
B, C = self.kernel.spatial_conditional(X, R, predict=True)
W = B @ H
test_mean = W @ state_mean
test_var = W @ state_cov @ transpose(W) + C
Expand Down

0 comments on commit fad0483

Please sign in to comment.