Skip to content
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 4th No.12】 为 paddle 新增 paddle.distribution.Cauchy 分布 #375

Merged
merged 6 commits into from
Feb 28, 2023

Conversation

dasenCoding
Copy link
Contributor

rfc : Cauchy Distribution

@paddle-bot
Copy link

paddle-bot bot commented Feb 22, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请检查PR提交格式和内容是否完备,具体请参考示例模版
Your PR has been submitted. Thanks for your contribution!
Please check its format and content. For this, you can refer to Template and Demo.

@dasenCoding
Copy link
Contributor Author

@luotao1 劳烦给检查一下提案哈哈哈!


`Cauchy distribution`的一个重要的特性是其均值和方差都不存在,并且没有高阶矩阵,正是这样的特性,使柯西分布常用于数据分析和贝叶斯统计学中非对称参数分布的情况。

目前 Paddle 框架中没有继承 Cauchy 分布。所以此任务的目标是在 Paddle 框架中,基于现有概率分布方案,在其基础上进行扩展,新增 Cauchy API,API 的调用路径为: `paddle.distribution.Cauchy`。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有继承 -> 没有实现;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

收到!


- stddev:标准差
> 注:Cauchy 分布不存在标准差

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要从概率分布本质上考虑下在Paddle中如何处理,比如抛异常,还是无穷大/无穷小表示

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要从概率分布本质上考虑下在Paddle中如何处理,比如抛异常,还是无穷大/无穷小表示

收到!

```python
def sample(self, shape):
sample(shape)
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rsample(shape)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rsample(shape)

收到!

@cxxly
Copy link

cxxly commented Feb 23, 2023

详细描述了Cauchy背景和应用,竞品分析部分也较为完备,测试用例也能看出来确实下了不少功夫,整体设计文档写的非常不错!

@dasenCoding
Copy link
Contributor Author

dasenCoding commented Feb 23, 2023

详细描述了Cauchy背景和应用,竞品分析部分也较为完备,测试用例也能看出来确实下了不少功夫,整体设计文档写的非常不错!

哈哈哈!非常感谢您的 review ,以及您的夸奖和认可!!

@dasenCoding
Copy link
Contributor Author

@cxxly 您上面提出的修改意见都已进行修改,劳烦抽空再给review一下,感谢!

Copy link

@cxxly cxxly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cxxly
Copy link

cxxly commented Feb 28, 2023

另外,@lwbmowgli 反馈该RFC与 https://github.com/PaddlePaddle/community/pull/362/files 测试用例与排期部分有相似之处,如 "随机采样30000个Cauchy分布下的样本值...",此处应该不能算作抄袭,但是确实借鉴了@lwbmowgli 模版;另外,具体采样点数,是一个经验数字,应该是由实验测试不同采样点数,权衡数值稳定和显存开销,设置一个较为合理的数值。设计文档中应当更具体说明,"此处为借鉴XX经验数字,具体数值根据实验结果修改"

1)请 @dasenCoding对相同的文字描述进行修改,另外参考同行工作,要在相关文档、代码、评论等处进行说明;
2)@lwbmowgli 如果仍有疑问,可以随时交流;

开源社区,在尊重别人工作基础上,鼓励大家相互协作,进行共建,希望两位共同努力,加油!

@dasenCoding
Copy link
Contributor Author

另外,@lwbmowgli 反馈该RFC与 https://github.com/PaddlePaddle/community/pull/362/files 测试用例与排期部分有相似之处,如 "随机采样30000个Cauchy分布下的样本值...",此处应该不能算作抄袭,但是确实借鉴了@lwbmowgli 模版;另外,具体采样点数,是一个经验数字,应该是由实验测试不同采样点数,权衡数值稳定和显存开销,设置一个较为合理的数值。设计文档中应当更具体说明,"此处为借鉴XX经验数字,具体数值根据实验结果修改"

1)请 @dasenCoding对相同的文字描述进行修改,另外参考同行工作,要在相关文档、代码、评论等处进行说明; 2)@lwbmowgli 如果仍有疑问,可以随时交流;

开源社区,在尊重别人工作基础上,鼓励大家相互协作,进行共建,希望两位共同努力,加油!

我参考了第三期黑客松中的RFC内容,并未直接抄袭本期中这位同学的RFC @lwbmowgli,与该RFC相似部分纯属巧合,我会指明参考的工作,避免产生误会。

@PaddlePaddle PaddlePaddle locked as off-topic and limited conversation to collaborators Feb 28, 2023
@luotao1 luotao1 merged commit 876af64 into PaddlePaddle:master Feb 28, 2023
@PaddlePaddle PaddlePaddle deleted a comment from lwbmowgli Mar 2, 2023
@PaddlePaddle PaddlePaddle deleted a comment from lwbmowgli Mar 2, 2023
@PaddlePaddle PaddlePaddle deleted a comment from lwbmowgli Mar 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants