-
Notifications
You must be signed in to change notification settings - Fork 5.8k
【Hackathon 6th No.5】Add chi2/LKJCholesky API to Paddle -part #63883
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提交成功,感谢你对开源项目的贡献! |
Sorry to inform you that 1269701's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
LGTM |
嗯嗯目前还剩下俩,看起来需要同学手动通过 |
please add link of rfc in description above. |
python/paddle/distribution/chi2.py
Outdated
if not paddle.all(self.df > 0): | ||
raise ValueError("The arg of `df` must be positive.") | ||
|
||
super().__init__(self.df, self.rate) |
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.
except __init__
, shall we need method of expand
?
|
||
# 5.Compute the normalization term and return the final log probability density: | ||
normalize_term = pi_constant + numerator - denominator | ||
return unnormalized_log_pdf - normalize_term |
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.
shall we need method of expand
?
sry, |
done. |
@cmcamdy 关于expand的问题,comment by @jeff41404 pytorch 中有expand方法,我们是否需要,设计文档中也没有说明,如果不需要,代码转换时如何替代 |
我明白了,实际上pytorch中的extend是对batch维度的扩展,如gamma中的实现:https://github.com/pytorch/pytorch/blob/e3ac61587aa368c613ef01df1f328a396b64cd5d/torch/distributions/gamma.py#L60 I see, in PyTorch, the expand functionality is actually used to extend the batch dimension, as exemplified in the Gamma distribution implementation: https://github.com/pytorch/pytorch/blob/e3ac61587aa368c613ef01df1f328a396b64cd5d/torch/distributions/gamma.py#L60 |
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
ok, thanks |
@luotao1 , 我重启了下APPROVAL的CI,似乎还需要下面几位同学的approve,这个CI里面的报错提示如下: |
Approval 流水线我们会来操作,请耐心等待 review 即可 |
Sorry to inform you that fe3edf2's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
Co-authored-by: zachary sun <70642955+sunzhongkai588@users.noreply.github.com>
Co-authored-by: zachary sun <70642955+sunzhongkai588@users.noreply.github.com>
已修改 |
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
需要为飞桨扩充 API paddle.distribution.chi2 和 paddle.distribution.LKJCholesky
1.实现分布chi2
2.实现分布LKJCholesky,支持sample_method参数,onion/cvine可选
3.两个单测的静态图模式同等规模下可能超时,因此手动改了个cmake超时设定,如下所示:
4.RFC-link:【Hackathon 6th No.5】为 Paddle 新增 chi2/LKJCholesky API #872