Created
August 17, 2017 15:50
-
-
Save vlavorini/1d7baaccc67c71936d10eb3d314cf91e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def den(points): | |
sq_norm=1-np.sum(np.square(points),1) #subtracting from 1 the squared norm of the vectors | |
expd=np.expand_dims(sq_norm,1) #this operation is needed to obtain a correctly transposed version of the vector | |
den_all=expd * expd.T #multiply the object by his transpose | |
return den_all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment