Repository navigation
【Hackathon 5th No.20】为 Paddle 新增 Exponential 和 Gamma API - #671
Merged
Merged
Conversation
GGBond8488
reviewed
Oct 11, 2023
|
|
||
| 对其他模块无影响。 | ||
|
|
||
| # 名词解释 |
|
|
||
| # 八、影响面 | ||
| 本次任务涉及以下内容: | ||
| 1. 新增 `paddle.distribution.exponential` 模块。 |
| paddle 调用 `Gamma` 的形式为: | ||
|
|
||
| ```python | ||
| paddle.distribution.gamma.Gamma(concentration, rate) |
Collaborator
There was a problem hiding this comment.
这和paddle现有distribution格式不符
|
|
||
| - `mean` 计算均值 | ||
| - `variance` 计算方差 | ||
| - `sample` 随机采样 |
| 在当前的 Paddle 框架中,`paddle.distribution` 目录内已经实现了一系列概率分布的 API,为了扩展现有的概率分布方案,本次任务计划实现伽马分布(Gamma Distribution)的 API。 | ||
|
|
||
| ## 2、功能目标 | ||
| 为 Paddle 框架增加 `paddle.distribution.gamma` 的 API,用于伽马分布的概率统计与随机采样。API 包括了如下方法: |
Collaborator
There was a problem hiding this comment.
命名应为paddle.distribution.Gamma
| @@ -0,0 +1,283 @@ | |||
| # paddle.distribution.gamma 设计文档 | |||
Collaborator
There was a problem hiding this comment.
命名应为paddle.distribution.Gamma
| @@ -0,0 +1,243 @@ | |||
| # paddle.distribution.exponential 设计文档 | |||
Collaborator
There was a problem hiding this comment.
命名应为paddle.distribution.Exponential,其他修改意见同Gamma Comment
GGBond8488
reviewed
Oct 18, 2023
|
|
||
| Exponential 概率分布的概率密度函数如下: | ||
|
|
||
| $$ f_{F}(x; \theta) = \theta e^{- \theta x }, (x \ge 0) $$ |
|
|
||
|
|
||
| # 一、概述 | ||
| ## 1、相关背景 |
Collaborator
There was a problem hiding this comment.
这里最好也把分布的特性加上吧,例如期望,方差,偏度等
|
|
||
| $$ \Gamma(\alpha)=\int_{0}^{\infty} x^{\alpha-1} e^{-x} \mathrm{~d} x, (\alpha>0) $$ | ||
|
|
||
| 其中参数 $\alpha$ 称为形状参数,$\beta$ 称为尺度参数。如果一个随机变量 $X$ 呈伽马分布,则可以写作 $X \sim Gamma(\alpha, \beta)$。 |
luotao1
approved these changes
Oct 19, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
任务说明 :链接