Skip to content

Commit

Permalink
⬆️ RSC
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRossetti committed May 13, 2024
1 parent 75a9d53 commit b66e83b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cdlib/algorithms/internal/RSC.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def __regularized_laplacian_matrix(adj_matrix, tau):

# diags will be zero at points where there is no edge and/or the node you are at
# ignore the error and make it zero later
with scipy.errstate(divide="ignore"):
diags_sqrt = 1.0 / scipy.sqrt(diags)
diags_sqrt[scipy.isinf(diags_sqrt)] = 0
#with scipy.errstate(divide="ignore"):
diags_sqrt = 1.0 / np.sqrt(diags)
diags_sqrt[np.isinf(diags_sqrt)] = 0
D = sp.spdiags(diags_sqrt, [0], m, n, format="csr")

L = I - (D.dot(adj_matrix.dot(D)))
Expand Down

0 comments on commit b66e83b

Please sign in to comment.