Created
June 10, 2017 23:39
-
-
Save dsjt/b6ee78d5d4119ae60aee7fa2243ae066 to your computer and use it in GitHub Desktop.
This file contains 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
# self.r.shape = (N , K) | |
# self.X.shape = (N, D) | |
# self.mu.shape = (K, D) | |
self.r = np.zeros((self.N, self.K)) | |
for i in range(self.N): | |
k = np.argmin([np.linalg.norm(self.X[i] - self.mu[k]) | |
for k in range(self.K)]) | |
self.r[i, k] = 1 | |
return self.r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment