Commit a13aac38 authored by lucas_miranda's avatar lucas_miranda
Browse files

Prototyped KNN_purity callback

parent 25dc77d6
...@@ -189,11 +189,7 @@ class one_cycle_scheduler(tf.keras.callbacks.Callback): ...@@ -189,11 +189,7 @@ class one_cycle_scheduler(tf.keras.callbacks.Callback):
def on_batch_end(self, epoch, logs=None): def on_batch_end(self, epoch, logs=None):
"""Add current learning rate as a metric, to check whether scheduling is working properly""" """Add current learning rate as a metric, to check whether scheduling is working properly"""
self.add_metric( return self.last_rate
self.last_rate,
aggregation="mean",
name="learning_rate",
)
class knn_cluster_purity(tf.keras.callbacks.Callback): class knn_cluster_purity(tf.keras.callbacks.Callback):
...@@ -256,11 +252,7 @@ class knn_cluster_purity(tf.keras.callbacks.Callback): ...@@ -256,11 +252,7 @@ class knn_cluster_purity(tf.keras.callbacks.Callback):
* np.max(groups[sample]) * np.max(groups[sample])
) )
self.add_metric( return purity_vector.mean()
self.purity_vector,
aggregation="mean",
name="knn_cluster_purity",
)
class uncorrelated_features_constraint(Constraint): class uncorrelated_features_constraint(Constraint):
......
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