Commit a07edada authored by lucas_miranda's avatar lucas_miranda
Browse files

Implemented KNN_purity callback

parent dd62bd2e
Pipeline #95529 failed with stages
in 26 minutes and 37 seconds
......@@ -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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment