I am trying to compute a vectorized implementation of Euclidean distance(between each element in X and Y using inner product). The data as follows:
X = np.random.uniform(low=0, high=1, size=(10000, 5))
Y = np.random.uniform(low=0, high=1, size=(10000, 5))
What I did was:
euclidean_distances_vectorized = np.array(np.sqrt(np.sum(X**2, axis=1) - 2 * np.dot(X, Y.T) + np.sum(Y**2, axis=1)))
Although this gives 'some output' the answer is wrong as each row still contains 5 elements.
Does anyone know what I am doing wrong?