-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update F.multi_label_soft_margin_loss/nn.MultiLabelSoftMarginLoss
docs 易用性提升
#7028
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,9 @@ MultiLabelSoftMarginLoss | |
损失函数按照下列公式计算 | ||
|
||
.. math:: | ||
\text{loss}(x, y) = \sum_{ij}\frac{\max(0, 1 - (x[y[j]] - x[i]))}{\text{x.shape}(0)} | ||
\text{loss}(input, label) = - \frac{1}{\text{C}} * \sum_i label[i] * \log((1 + \exp(-input[i]))^{-1}) + (1-label[i]) * \log\left(\frac{\exp(-input[i])}{(1 + \exp(-input[i]))}\right) | ||
|
||
其中 :math:`\text{C}` 为类别数量, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个后面是一个逗号吗 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已改为句号,这一句是对上面公式的说明 |
||
|
||
如果添加权重则再乘以对应的权重值 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这两句话 感觉也不太通顺 |
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,9 @@ multi_label_soft_margin_loss | |
损失函数按照下列公式计算 | ||
|
||
.. math:: | ||
\text{loss}(x, y) = \sum_{ij}\frac{\max(0, 1 - (x[y[j]] - x[i]))}{\text{x.shape}(0)} | ||
\text{loss}(input, label) = - \frac{1}{\text{C}} * \sum_i label[i] * \log((1 + \exp(-input[i]))^{-1}) + (1-label[i]) * \log\left(\frac{\exp(-input[i])}{(1 + \exp(-input[i]))}\right) | ||
|
||
其中 :math:`\text{C}` 为类别数量, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 同上 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已改为句号,这一句是对上面公式的说明 |
||
|
||
如果添加权重则再乘以对应的权重值 | ||
|
||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是文档写成了MultiLabelMarginLoss,但是实现是MultiLabelSoftMarginLoss 对吧?MultiLabelSoftMarginLoss 没有问题吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的