-
Notifications
You must be signed in to change notification settings - Fork 5.8k
【Hackathon 6th No.16】为 Paddle 新增 LPPool1D / LPPool2D API -part #63544
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@cyber-pioneer 老师大部分CI已通过,请先审一下吧。 |
Sorry to inform you that 7c9e1dd's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
Sorry to inform you that d1f4508's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
norm_type=norm_type, | ||
pool_type='lp', | ||
) | ||
np.testing.assert_allclose(result.numpy(), result_np, rtol=1e-05) |
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.
精度现在只能对齐到1e-5么?
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.
是的,其他pool2d的精度也是1e-5
缺少float16和float64的单测? |
任务完成度很高,手动点赞👍 |
@Asthestarsfalll 需要附上 RFC 链接。如果之前的RFC思路和你这儿的有所区别,需要提一个修改 RFC 的PR |
已添加~ |
Sorry to inform you that 1cba1b5's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
@cyber-pioneer 老师请审核~ |
冲突了,而且DCU流水线失败,需要修复 |
d6329dd
to
015f667
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
python/paddle/nn/layer/pooling.py
Outdated
@@ -321,6 +322,211 @@ def extra_repr(self): | |||
) | |||
|
|||
|
|||
class LPPool1D(Layer): | |||
r""" | |||
This operation applies a 1D power-average pooling over an input signal composed |
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.
This operation
删了吧,文档里不要出现 OP 的概念
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.
已修改
python/paddle/nn/layer/pooling.py
Outdated
4. A list[int] or tuple(int) whose length is 2. It has the form [pad_before, pad_after]. | ||
5. A list or tuple of pairs of integers. It has the form [[pad_before, pad_after], [pad_before, pad_after], ...]. Note that, the batch dimension and channel dimension should be [0,0] or (0,0). | ||
The default value is 0. | ||
ceil_mode(bool, optional): ${ceil_mode_comment}Whether to use the ceil function to calculate output height |
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.
${ceil_mode_comment}
这个是啥
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.
LGTM
PR Category
Others
PR Types
Others
Description
rfc:
中文文档:
lp pool,前向公式
反向公式
本实现直接借用了$\infty$ 时,等价与最大池化,因此直接调用了

PoolRawKernel
,当norm_type
为MaxPool
;这样似乎可以直接支持LPPool3D,如果有需求的话。单测结果: