Commit ba3cb317 authored by Martin Wicke's avatar Martin Wicke Committed by GitHub
Browse files

Update losses.py

parent bda41af1
...@@ -163,8 +163,8 @@ def cross_entropy_loss(logits, one_hot_labels, label_smoothing=0, ...@@ -163,8 +163,8 @@ def cross_entropy_loss(logits, one_hot_labels, label_smoothing=0,
smooth_positives = 1.0 - label_smoothing smooth_positives = 1.0 - label_smoothing
smooth_negatives = label_smoothing / num_classes smooth_negatives = label_smoothing / num_classes
one_hot_labels = one_hot_labels * smooth_positives + smooth_negatives one_hot_labels = one_hot_labels * smooth_positives + smooth_negatives
cross_entropy = tf.nn.softmax_cross_entropy_with_logits(logits, cross_entropy = tf.nn.softmax_cross_entropy_with_logits(logits=logits,
one_hot_labels, labels=one_hot_labels,
name='xentropy') name='xentropy')
weight = tf.convert_to_tensor(weight, weight = tf.convert_to_tensor(weight,
dtype=logits.dtype.base_dtype, dtype=logits.dtype.base_dtype,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment