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

Implemented shuffle parameter in preprocessing; shuffled validation data in model_training.py

parent d908c12d
Branches
Tags
No related merge requests found
...@@ -171,6 +171,7 @@ class Latent_space_control(Layer): ...@@ -171,6 +171,7 @@ class Latent_space_control(Layer):
# Adds Silhouette score controling overlap between clusters # Adds Silhouette score controling overlap between clusters
hard_labels = tf.math.argmax(z_cat, axis=1) hard_labels = tf.math.argmax(z_cat, axis=1)
silhouette = tf.numpy_function(silhouette_score, [z, hard_labels], tf.float32) silhouette = tf.numpy_function(silhouette_score, [z, hard_labels], tf.float32)
self.add_loss(- K.mean(silhouette), inputs=[z, hard_labels])
self.add_metric(silhouette, aggregation="mean", name="silhouette") self.add_metric(silhouette, aggregation="mean", name="silhouette")
return z return z
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment