-
Notifications
You must be signed in to change notification settings - Fork 273
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 5th No.20】为 Paddle 新增 Exponential 和 Gamma API #671
Conversation
|
||
对其他模块无影响。 | ||
|
||
# 名词解释 |
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.
Done.
|
||
# 八、影响面 | ||
本次任务涉及以下内容: | ||
1. 新增 `paddle.distribution.exponential` 模块。 |
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.
这里应该是Gamma吧
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.
Done.
paddle 调用 `Gamma` 的形式为: | ||
|
||
```python | ||
paddle.distribution.gamma.Gamma(concentration, 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.
这和paddle现有distribution格式不符
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.
Done.
|
||
- `mean` 计算均值 | ||
- `variance` 计算方差 | ||
- `sample` 随机采样 |
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.
是否少了rssample?
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.
Done.
在当前的 Paddle 框架中,`paddle.distribution` 目录内已经实现了一系列概率分布的 API,为了扩展现有的概率分布方案,本次任务计划实现伽马分布(Gamma Distribution)的 API。 | ||
|
||
## 2、功能目标 | ||
为 Paddle 框架增加 `paddle.distribution.gamma` 的 API,用于伽马分布的概率统计与随机采样。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.
命名应为paddle.distribution.Gamma
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.
Done.
@@ -0,0 +1,283 @@ | |||
# paddle.distribution.gamma 设计文档 |
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.
命名应为paddle.distribution.Gamma
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.
好的,已修改
@@ -0,0 +1,243 @@ | |||
# paddle.distribution.exponential 设计文档 |
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.
命名应为paddle.distribution.Exponential,其他修改意见同Gamma 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.
好的
|
||
Exponential 概率分布的概率密度函数如下: | ||
|
||
$$ f_{F}(x; \theta) = \theta e^{- \theta x }, (x \ge 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.
这个F应该不用加
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.
Done.
|
||
|
||
# 一、概述 | ||
## 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.
这里最好也把分布的特性加上吧,例如期望,方差,偏度等
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.
好的
|
||
$$ \Gamma(\alpha)=\int_{0}^{\infty} x^{\alpha-1} e^{-x} \mathrm{~d} x, (\alpha>0) $$ | ||
|
||
其中参数 $\alpha$ 称为形状参数,$\beta$ 称为尺度参数。如果一个随机变量 $X$ 呈伽马分布,则可以写作 $X \sim Gamma(\alpha, \beta)$。 |
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.
beta 没有正确解析
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.
Done.
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
任务说明 :链接