Skip to content
Snippets Groups Projects
Commit a07edada authored by Lucas Miranda's avatar Lucas Miranda
Browse files

Implemented KNN_purity callback

parent dd62bd2e
Branches
Tags
No related merge requests found
Pipeline #95529 failed
......@@ -257,6 +257,7 @@ class knn_cluster_purity(tf.keras.callbacks.Callback):
knn = NearestNeighbors().fit(encoding)
# Iterate over samples and compute purity over k neighbours
self.samples = np.min([self.samples, encoding.shape[0]])
random_idxs = np.random.choice(
range(encoding.shape[0]), self.samples, replace=False
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment