mirror of
https://github.com/sbrl/research-rainfallradar
synced 2024-11-25 18:33:01 +00:00
LossCrossentropy: don't sum
This commit is contained in:
parent
08046340f4
commit
a3c9416cf0
1 changed files with 3 additions and 3 deletions
|
@ -16,10 +16,10 @@ class LossCrossentropy(tf.keras.losses.Loss):
|
||||||
|
|
||||||
def call(self, y_true, y_pred):
|
def call(self, y_true, y_pred):
|
||||||
result = tf.keras.metrics.categorical_crossentropy(y_true, y_pred)
|
result = tf.keras.metrics.categorical_crossentropy(y_true, y_pred)
|
||||||
result_reduce = tf.math.reduce_sum(result)
|
# result_reduce = tf.math.reduce_sum(result)
|
||||||
label_nowater = tf.math.reduce_sum(tf.argmax(y_true, axis=-1))
|
# label_nowater = tf.math.reduce_sum(tf.argmax(y_true, axis=-1))
|
||||||
# tf.print("DEBUG:TFPRINT:loss LABEL", y_true.shape, y_true, "LABEL_ARGMAX_COUNT_AXIS0", label_nowater, "PREDICT", y_pred.shape, y_pred, "BEFORE_REDUCE", result.shape, result, "AFTER_REDUCE", result_reduce.shape, result_reduce)
|
# tf.print("DEBUG:TFPRINT:loss LABEL", y_true.shape, y_true, "LABEL_ARGMAX_COUNT_AXIS0", label_nowater, "PREDICT", y_pred.shape, y_pred, "BEFORE_REDUCE", result.shape, result, "AFTER_REDUCE", result_reduce.shape, result_reduce)
|
||||||
return result_reduce
|
return result
|
||||||
|
|
||||||
def get_config(self):
|
def get_config(self):
|
||||||
config = super(LossCrossentropy, self).get_config()
|
config = super(LossCrossentropy, self).get_config()
|
||||||
|
|
Loading…
Reference in a new issue