Skip to content

Commit 63d3117

Browse files
Fix an edge case (1-D Gaussians) (#5)
The optimal covariance function had a legacy use of numpy and not jax.numpy which was not caught by the test due to the lack of jitting of this function...
1 parent 48a3dfc commit 63d3117

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

  • coupled_rejection_sampling

coupled_rejection_sampling/mvn.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import jax.random
66
import jax.scipy.linalg as jlinalg
77
import jax.scipy.stats as jstats
8-
import numpy as np
98
from jax import numpy as jnp
109
from jax.scipy.linalg import cho_solve
1110

@@ -33,7 +32,7 @@ def get_optimal_covariance(chol_P, chol_Sig):
3332
"""
3433
d = chol_P.shape[0]
3534
if d == 1:
36-
return np.maximum(chol_P, chol_Sig)
35+
return jnp.maximum(chol_P, chol_Sig)
3736

3837
right_Y = jlinalg.solve_triangular(chol_P, chol_Sig, lower=True) # Y = RY.T RY
3938
w_Y, v_Y = jlinalg.eigh(right_Y.T @ right_Y)

0 commit comments

Comments
 (0)