Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
xunzheng committed Dec 5, 2019
1 parent 2d6c73a commit 968da14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def count_accuracy(B_true, B_est):
shd: undirected extra + undirected missing + reverse
nnz: prediction positive
"""
if (B_est == -1).any() and ((B_est == -1) == (B_est.T == -1)).any():
if ((B_est == -1) & (B_est.T == -1)).any():
raise ValueError('undirected edge should only appear once')
d = B_true.shape[0]
# linear index of nonzeros
Expand Down

0 comments on commit 968da14

Please sign in to comment.