From 2f0ce0aa138692ae89821cd72c0af1f89222755e Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 13 Jan 2023 18:27:03 +0000 Subject: [PATCH] again --- aimodel/src/lib/ai/components/LossCrossEntropyDice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aimodel/src/lib/ai/components/LossCrossEntropyDice.py b/aimodel/src/lib/ai/components/LossCrossEntropyDice.py index 2037011..f411fb0 100644 --- a/aimodel/src/lib/ai/components/LossCrossEntropyDice.py +++ b/aimodel/src/lib/ai/components/LossCrossEntropyDice.py @@ -31,7 +31,7 @@ class LossCrossEntropyDice(tf.keras.losses.Loss): def call(self, y_true, y_pred): y_true = tf.cast(y_true, tf.float32) - y_true = tf.cast(tf.one_hot(y_true, 2), dtype=tf.int32) # Input is sparse + y_true = tf.one_hot(tf.cast(y_true, dtype=tf.int32), 2) # Input is sparse o = tf.nn.sigmoid_cross_entropy_with_logits(y_true, y_pred) + dice_loss(y_true, y_pred) return tf.reduce_mean(o)