Skip to content

Commit

Permalink
fix square bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nperraud committed May 14, 2020
1 parent 27ed937 commit 2e80742
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pygsp/graphs/learned.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,11 +531,11 @@ def __init__(self, X, a=None, b=None, k=10, kk=None, sparse=True, rel_edge=1e-5,
if kk is None:
kk = 3*k
neighbors, distances = nearest_neighbor(X, k=kk, **param_nn)
Z = sparse_distance_matrix(neighbors, distances)
Z = sparse_distance_matrix(neighbors, distances**2)
edge_mask = Z>0
Zp = distances[:,1:]
else:
Z = distanz(X.transpose())
Z = distanz(X.transpose())**2
Zp = Z
edge_mask = None
if a is None and b is None:
Expand Down

2 comments on commit 2e80742

@GautamSridhar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there should be squaring in Zp = distances[:,1:] as well for proper theta calculation. It should be Zp = distances[:,1:]**2

@nperraud
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GautamSridhar you are right! thanks

Please sign in to comment.