Skip to content

Commit

Permalink
Add a missing type cast and fix a typo in kernels/karhunen_loeve.py
Browse files Browse the repository at this point in the history
  • Loading branch information
vabor112 committed Jul 10, 2024
1 parent 2e3e5e0 commit da2b0d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions geometric_kernels/kernels/karhunen_loeve.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def K(

weights = B.cast(B.dtype(params["nu"]), self.eigenvalues(params)) # [L, 1]
Phi = self.eigenfunctions
K = Phi.weighted_outerproduct(weights, X, X2, **params) # [N, N2]
K = Phi.weighted_outerproduct(weights, X, X2, **kwargs) # [N, N2]
if is_complex(K):
return B.real(K)
else:
Expand All @@ -210,9 +210,9 @@ def K_diag(self, params, X: B.Numeric, **kwargs) -> B.Numeric:
assert "nu" in params
assert params["nu"].shape == (1,)

weights = self.eigenvalues(params) # [L, 1]
weights = B.cast(B.dtype(params["nu"]), self.eigenvalues(params)) # [L, 1]
Phi = self.eigenfunctions
K_diag = Phi.weighted_outerproduct_diag(weights, X, **params) # [N,]
K_diag = Phi.weighted_outerproduct_diag(weights, X, **kwargs) # [N,]
if is_complex(K_diag):
return B.real(K_diag)
else:
Expand Down

0 comments on commit da2b0d1

Please sign in to comment.