From cf825d09145fde14a57c51e0e117bcda333c2b44 Mon Sep 17 00:00:00 2001 From: samu2604 Date: Tue, 17 May 2022 15:20:44 +0200 Subject: [PATCH] Removal of the redundant sigmoid function, as pointed out in the reusability report https://doi.org/10.1038/s42256-022-00454-y --- EMOGI/emogi.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/EMOGI/emogi.py b/EMOGI/emogi.py index 5da2718..65e3ccb 100644 --- a/EMOGI/emogi.py +++ b/EMOGI/emogi.py @@ -235,9 +235,8 @@ def masked_softmax_cross_entropy_weight(self, scores, labels, mask): loss = tf.nn.softmax_cross_entropy_with_logits(logits=scores, labels=labels) else: # two classes, let's do sigmoid and weights - prediction = tf.nn.sigmoid(scores) loss = tf.nn.weighted_cross_entropy_with_logits(targets=labels, - logits=prediction, + logits=scores, pos_weight=self.pos_loss_multiplier) # mask loss for nodes we don't know mask = tf.cast(mask, dtype=tf.float32)