-
Notifications
You must be signed in to change notification settings - Fork 275
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 4 No.16】为 Paddle 新增 PoissonNLLLoss API #395
Conversation
59ea691
to
7ab5020
Compare
7ab5020
to
c6b0401
Compare
|
||
# 四、对比分析 | ||
|
||
设计方案将参考PyTorch的实现,在当前版本的API当中仅实现Python版本,对于PyTorch实现中部分抛弃的参数不再做兼容。 |
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.
更新在了第四部分中
|
||
## 1、相关背景 | ||
|
||
paddle.nn.PoissonNLLLoss 和 paddle.nn.functional.Poisson_nll_loss API 用于泊松分布的负对数似然函数的计算。 |
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.
更新了对于API的描述
\text{loss}(\text{input}, \text{target}) = \text{input} - \text{target} * \log(\text{input}) + \log(\text{target!}) | ||
$$ | ||
|
||
损失函数中的最后一项可以使用Stirling公式近似,当target的值超过1时考虑此项近似,当target的值小于等于1的时候设置为0。 |
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和小于1怎么定义?
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的Tensor进行elemen-wise的比较,小于等于1的地方mask掉对应的逼近项。在PyTorch的实现中调用的是Tensor.masked_fill(mask, value)。
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.
在设计文档和中文文档中补充了这个说明。
74005df
to
767c243
Compare
767c243
to
be47ea8
Compare
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.
LGTM
Add PoissonNLLLoss API rfc file