Skip to content

Commit

Permalink
Fix the grad weighted minkowski as well...
Browse files Browse the repository at this point in the history
  • Loading branch information
lmcinnes committed Feb 9, 2022
1 parent 28bea09 commit c9628e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion umap/distances.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def weighted_minkowski_grad(x, y, w=_mock_ones, p=2):
"""
result = 0.0
for i in range(x.shape[0]):
result += (w[i] * np.abs(x[i] - y[i])) ** p
result += w[i] * (np.abs(x[i] - y[i])) ** p

grad = np.empty(x.shape[0], dtype=np.float32)
for i in range(x.shape[0]):
Expand Down

0 comments on commit c9628e5

Please sign in to comment.