Lets say I have a list as following:
points = np.array( [ . . . ] , [ . . .], [ . . .] ) # shape is (500000, 1000)
and another list as
target = np.array([ . . .]) #shape is (1000,)
Now I can compute the L2 norm as following:
norm = np.linalg.norm(points - target, axis=1)
This works perfectly but its super slow when I want execute this for 100K target values. For the moment I get a target value from the targets list and calculate norm for each target.
Is there a quick way to do this?