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

add cdf function for gumbel #298

Merged
merged 1 commit into from
Oct 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions rfcs/APIs/20220908_api_design_for_gumbel.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- `rsample` 重参数化采样;
- `prob` 概率密度;
- `log_prob`对数概率密度;
- `cdf`累积分布函数;
- `entropy` 熵计算;

## 3、意义
Expand Down Expand Up @@ -533,6 +534,11 @@ exp(-(value - self.loc) / self.scale - exp(-(value - self.loc) / self.scale)) /
np.log(self.probs(value))
```

- cdf(value):累积分布函数
```python
paddle.exp(-paddle.exp(-(value - self.loc) / self.scale))
```

- entropy(scale):熵
```python
self.scale.log() + (1 + np.euler_gamma)
Expand Down