From 6640a41bb78a79413d99f75a86e5c2b14332427d Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 28 Nov 2022 19:08:50 +0000 Subject: [PATCH] almost got it....? it's not what I expected....! --- aimodel/src/lib/ai/components/LossCrossentropy.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aimodel/src/lib/ai/components/LossCrossentropy.py b/aimodel/src/lib/ai/components/LossCrossentropy.py index 35c6ea5..5c06f68 100644 --- a/aimodel/src/lib/ai/components/LossCrossentropy.py +++ b/aimodel/src/lib/ai/components/LossCrossentropy.py @@ -17,6 +17,7 @@ class LossCrossentropy(tf.keras.losses.Loss): def call(self, y_true, y_pred): result = tf.keras.metrics.categorical_crossentropy(y_true, y_pred) result_reduce = tf.math.reduce_sum(result) + label_nowater = tf.math.reduce_sum(tf.argmax(y_true, axis=-1)) tf.print("DEBUG:TFPRINT:loss LABEL", y_true.shape, y_true, "PREDICT", y_pred.shape, y_pred, "BEFORE_REDUCE", result.shape, result, "AFTER_REDUCE", result_reduce.shape, result_reduce) return result