Skip to content

Commit

Permalink
[ADD][FEAT](loss) Add SigmoidCrossEntropyLoss
Browse files Browse the repository at this point in the history
  • Loading branch information
wbenbihi committed Aug 23, 2022
1 parent 7c975af commit 7384c59
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Empty file.
14 changes: 14 additions & 0 deletions hourglass_tensorflow/losses/sigmoid_cross_entropy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import tensorflow as tf
import keras.losses


class SigmoidCrossEntropyLoss(keras.losses.Loss):
def __init__(self, reduction=..., name=None, *args, **kwargs):
super().__init__(reduction, name)

def call(self, y_true, y_pred):
return tf.nn.sigmoid_cross_entropy_with_logits(
logits=y_pred,
labels=y_true,
name="nn.sigmoid_cross_entropy_with_logits",
)

0 comments on commit 7384c59

Please sign in to comment.