Skip to content

Fix scoreutils #238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions causallearn/utils/ScoreUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,15 +619,15 @@ def cov_seard(loghyper=None, x=None, z=None, nargout=1):
sf2 = np.exp(2 * loghyper[D]) # signal variance

if loghyper is not None and x is not None:
K = sf2 * np.exp(-sq_dist(np.diag(1 / ell) * x.T) / 2)
K = sf2 * np.exp(-sq_dist(np.diag(1 / ell) @ x.T) / 2)
A = K
elif nargout == 2: # compute test set covariances
A = sf2 * np.ones((z, 1))
B = sf2 * np.exp(-sq_dist(np.diag(1 / ell) * x.T, np.diag(1 / ell) * z) / 2)
B = sf2 * np.exp(-sq_dist(np.diag(1 / ell) @ x.T, np.diag(1 / ell) @ z) / 2)
else:
# check for correct dimension of the previously calculated kernel matrix
if K.shape[0] != n or K.shape[1] != n:
K = sf2 * np.exp(-sq_dist(np.diag(1 / ell) * x.T) / 2)
K = sf2 * np.exp(-sq_dist(np.diag(1 / ell) @ x.T) / 2)

if z <= D: # length scale parameters
A = np.multiply(K, sq_dist(x[:, z].T / ell[z]))
Expand Down