Skip to content

Conversation

@NKNaN
Copy link
Contributor

@NKNaN NKNaN commented Apr 29, 2024

新增 StudentT API 的 rfcs。
MultivariateNormal 上次写过了,是需要改吗?

@paddle-bot
Copy link

paddle-bot bot commented Apr 29, 2024

你的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.

@luotao1
Copy link
Collaborator

luotao1 commented May 7, 2024

MultivariateNormal 上次写过了,是需要改吗?

如果可以复用上次的RFC,就不需要改。如果有一些变化,在上次的RFC基础上改就行。

D_{KL} & = \log \Gamma(\frac{\nu_1+1}{2}) - \log \Gamma(\frac{\nu_2+1}{2}) + \frac{1}{2}\log\frac{\nu_2}{\nu_1} + \log\frac{\sigma_2}{\sigma_1} - \log\Gamma(\frac{\nu_1}{2}) + \log\Gamma(\frac{\nu_2}{2}) \\
& - \frac{\nu_1+1}{2} [\psi(\frac{1+\nu_1}{2}) - \psi(\frac{\nu_1}{2})] + \frac{\nu_2+1}{2} [\psi(\frac{1+\nu_2}{2}) - \psi(\frac{\nu_2}{2})]
\end{align*}
$$

Choose a reason for hiding this comment

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

image 注意方案描述部分的排版问题和乱码问题。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

Choose a reason for hiding this comment

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

image df>1,为xx;df<=1。这些应该有个分号,便于阅读。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改



# 四、对比分析
Pytorch 与 Tensorflow_probability 实现方式大体类似, 由于t分布是连续的概率分布,相应的概率属性都可以通过基本的概率计算得到。而在 Tensorflow_probability 中除了实现了mean, variance, log_prob, entropy 等方法外还实现了 cdf, survival function, quantile 等方法。考虑与 paddle 现有概率分布类 API 保持一致,参照 pytorch 的实现方式。

Choose a reason for hiding this comment

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

我看参考资料还有scipy,但是前文并没有列出,可以补充下,也可以帮助后面决定是否要增加cdf等方法。tf额外实现cdf、survival等方法,目的是什么,paddle应该实现嘛?实现了也不影响API之间保持一致吧。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已添加

@NKNaN
Copy link
Contributor Author

NKNaN commented May 8, 2024

如果可以复用上次的RFC,就不需要改。如果有一些变化,在上次的RFC基础上改就行。

MultivariateNormal 在 paddle 2.6 版本中已有,是否需要继续修改呢? https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/distribution/MultivariateNormal_cn.html#cn-api-paddle-distribution-multivariatenormal

需满足 `df>0`, `scale>0`
类包含的方法及实现方案如下:

- `mean` 计算均值

Choose a reason for hiding this comment

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

后面都是xx的计算方法,统一下。还有注意此处排版,缩进级别和内容并不匹配。其他没有问题

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

@xuxinyi389
Copy link

如果可以复用上次的RFC,就不需要改。如果有一些变化,在上次的RFC基础上改就行。

MultivariateNormal 在 paddle 2.6 版本中已有,是否需要继续修改呢? https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/distribution/MultivariateNormal_cn.html#cn-api-paddle-distribution-multivariatenormal

可以复用

@xuxinyi389
Copy link

LGTM

@luotao1 luotao1 merged commit 237ca55 into PaddlePaddle:master May 9, 2024
@NKNaN NKNaN deleted the hack6 branch August 27, 2024 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants