Skip to content

Commit

Permalink
Fix some deprecation warning in losses.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
XericZephyr committed Aug 20, 2019
1 parent f51dc7d commit f6620e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def calculate_loss(self,
with tf.name_scope("loss_xent"):
epsilon = 1e-5
float_labels = tf.cast(labels, tf.float32)
cross_entropy_loss = float_labels * tf.log(predictions + epsilon) + (
1 - float_labels) * tf.log(1 - predictions + epsilon)
cross_entropy_loss = float_labels * tf.math.log(predictions + epsilon) + (
1 - float_labels) * tf.math.log(1 - predictions + epsilon)
cross_entropy_loss = tf.negative(cross_entropy_loss)
if label_weights is not None:
cross_entropy_loss *= label_weights
Expand Down

0 comments on commit f6620e7

Please sign in to comment.