aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/losses
diff options
context:
space:
mode:
authorGravatar Petros Mol <pmol@google.com>2018-05-21 17:15:39 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-05-21 17:18:16 -0700
commitc3587c5f25ed9dfc173476e61b1ec0445c2989be (patch)
treea5d16b3032c310c71175945483ea58626ba62a8e /tensorflow/contrib/losses
parent006e293c7bc8a30ea8f9618cd305bc8719a96638 (diff)
Improves documentation of labels and logits arguments in hinge loss methods .
PiperOrigin-RevId: 197487120
Diffstat (limited to 'tensorflow/contrib/losses')
-rw-r--r--tensorflow/contrib/losses/python/losses/loss_ops.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tensorflow/contrib/losses/python/losses/loss_ops.py b/tensorflow/contrib/losses/python/losses/loss_ops.py
index bdad34a665..651de4e2f4 100644
--- a/tensorflow/contrib/losses/python/losses/loss_ops.py
+++ b/tensorflow/contrib/losses/python/losses/loss_ops.py
@@ -482,9 +482,12 @@ def hinge_loss(logits, labels=None, scope=None):
"""Method that returns the loss tensor for hinge loss.
Args:
- logits: The logits, a float tensor.
+ logits: The logits, a float tensor. Note that logits are assumed to be
+ unbounded and 0-centered. A value > 0 (resp. < 0) is considered a positive
+ (resp. negative) binary prediction.
labels: The ground truth output tensor. Its shape should match the shape of
- logits. The values of the tensor are expected to be 0.0 or 1.0.
+ logits. The values of the tensor are expected to be 0.0 or 1.0. Internally
+ the {0,1} labels are converted to {-1,1} when calculating the hinge loss.
scope: The scope for the operations performed in computing the loss.
Returns: