You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/01/14 22:36:30 UTC

[GitHub] szha commented on a change in pull request #9265: Add label_from_zero_one argument to LogisticLoss

szha commented on a change in pull request #9265: Add label_from_zero_one argument to LogisticLoss
URL: https://github.com/apache/incubator-mxnet/pull/9265#discussion_r161412513
 
 

 ##########
 File path: python/mxnet/gluon/loss.py
 ##########
 @@ -619,16 +619,19 @@ class LogisticLoss(Loss):
         L = \sum_i \log(1 + \exp(- {pred}_i \cdot {label}_i))
 
     where `pred` is the classifier prediction and `label` is the target tensor
-    containing values -1 or 1. `pred` and `label` can have arbitrary shape as
-    long as they have the same number of elements.
+    containing values -1 or 1 (0 or 1 if `label_format` is binary).
+     `pred` and `label` can have arbitrary shape as long as they have the same number of elements.
 
     Parameters
     ----------
     weight : float or None
         Global scalar weight for loss.
     batch_axis : int, default 0
         The axis that represents mini-batch.
-
+    label_format : str, default 'signed'
+        Can be either 'signed' or 'binary'. If the label_format is 'signed', all label values should
+        be either -1 or 1. If the label_format is 'binary', all label values should be either
+        0 or 1.
 
     Inputs:
         - **pred**: prediction tensor with arbitrary shape.
 
 Review comment:
   The docstring below should have been updated to reflect the introduction of `label_format`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services