Commits

dan mackinlay committed 1c1f1b5

actually normalize

Comments (0)

Files changed (1)

 def normalise_lengths(row_vectors):
     """normalise the lengths of some stacked row vectors.
     """
-    return row_vectors / (np.sum(row_vectors * row_vectors, 1).reshape(-1,1))
+    return row_vectors / np.sqrt(np.sum(np.square(row_vectors), 1)).reshape(-1,1)