Skip to content
Snippets Groups Projects
Commit 1c34f86e authored by BaptisteBrd's avatar BaptisteBrd
Browse files

knn fst commit

parent 0386569d
No related branches found
No related tags found
No related merge requests found
knn.py 0 → 100644
import numpy as np
def distance_matrix(a,b):
sx = np.sum(a**2, axis=1, keepdims=True)
sy = np.sum(b**2, axis=1, keepdims=True)
dists = np.sqrt(-2 * a.dot(b.T) + sx + sy.T)
return dists
if __name__ == "__main__" :
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment