From e04d6ab1b6bbd7655a6da6b04f443a1753793d5e Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 13 Jan 2023 18:23:32 +0000 Subject: [PATCH] fixup 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 ce20cd7..2037011 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.one_hot(y_true, 2) # Input is sparse + y_true = tf.cast(tf.one_hot(y_true, 2), dtype=tf.int32) # 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)