-
Notifications
You must be signed in to change notification settings - Fork 764
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
base: develop
Are you sure you want to change the base?
Conversation
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7028.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
@@ -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) |
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.
是的
@@ -1,44 +0,0 @@ | |||
## [ paddle 参数更多 ]torch.nn.MultiLabelMarginLoss |
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.
在pytorch_api_mapping.md这个映射表里,将 MultiLabelMarginLoss 的映射改一下吧,应该是 功能缺失且较好实现 那一类
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.
好的
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.
在pytorch_api_mapping.md这个映射表里,将 MultiLabelMarginLoss 的映射改一下吧,应该是 功能缺失且较好实现 那一类
这个修改了吗
@NKNaN 上面这个修改了吗 |
已修改 |
\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 comment
The reason will be displayed to describe this comment to others. Learn more.
这两句话 感觉也不太通顺
\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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
已改为句号,这一句是对上面公式的说明
\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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
已改为句号,这一句是对上面公式的说明
PaddlePaddle/Paddle#70389
修复 MultiLabelSoftMarginLoss 公式以及删除 torch.nn.MultiLabelMarginLoss 的映射文档