-
Notifications
You must be signed in to change notification settings - Fork 758
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
Hackathon No.21 #4723
Hackathon No.21 #4723
Conversation
Thanks for your contribution! |
@@ -0,0 +1,36 @@ | |||
.. _cn_api_paddle_nn_functional_soft_margin_losss: |
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.
多了个 s
soft_margin_loss | ||
------------------------------- | ||
|
||
.. py:function:: paddle.nn.functional.soft_margin_loss(input, label, weight:Optional=None, reduction: str = 'mean') |
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.
没有 weight 参数吧
::::::::: | ||
- **input** (Tensor) - :math:`[N, *]` ,其中N是batch_size, `*` 是任意其他维度。数据类型是float32、float64。 | ||
- **label** (Tensor) - :math:`[N, *]` ,标签 ``label`` 的维度、数据类型与输入 ``input`` 相同。 | ||
- **weight** (Tensor,可选) - 手动指定每个batch二值交叉熵的权重,如果指定的话,维度必须是一个batch的数据的维度。数据类型是float32, float64。默认值是:None。 |
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_i \frac{\log(1 + \exp(-y[i]*x[i]))}{\text{x.nelement}()} | ||
|
||
|
||
最后,添加 `reduce` 操作到前面的输出Out上。当 `reduction` 为 `none` 时,直接返回最原始的 `Out` 结果。当 `reduction` 为 `mean` 时,返回输出的均值 :math:`Out = MEAN(Out)` 。当 `reduction` 为 `sum` 时,返回输出的求和 :math:`Out = SUM(Out)` 。 |
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.
这一段英文没有,建议补充一下
SoftMarginLoss API 中文文档
PADDLEPADDLE_PR=42364
【Hackathon No.21】