Skip to content

Commit 39e845f

Browse files
aaditgupta21klane
andauthored
Fix symmetry enforcement with sparse matrices in Laplacian filter (#52)
* laplacian error fix * Revert "laplacian error fix" This reverts commit 63c73e0. * Convert sparse adjacency matrix to dense Prevents error when enforcing symmetry Co-authored-by: Kevin Lane <[email protected]>
1 parent 6071118 commit 39e845f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

torchts/utils/graph.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ def reverse_random_walk(adj_mx):
3030

3131

3232
def scaled_laplacian(adj_mx, lambda_max=2, undirected=True):
33+
if sp.issparse(adj_mx):
34+
adj_mx = adj_mx.todense()
35+
3336
if undirected:
3437
adj_mx = np.maximum.reduce([adj_mx, adj_mx.T])
3538

0 commit comments

Comments
 (0)