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 MultivariateNormal distribution API #47825

Closed
wants to merge 39 commits into from

Conversation

dasenCoding
Copy link
Contributor

@dasenCoding dasenCoding commented Nov 10, 2022

PR types

New features

PR changes

APIs

Describe

新增 MultivariateNormal 分布API
设计文档:PaddlePaddle/community#320
中文api文档:PaddlePaddle/docs#5551

@paddle-bot
Copy link

paddle-bot bot commented Nov 10, 2022

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Nov 10, 2022
@luotao1
Copy link
Contributor

luotao1 commented Nov 14, 2022

@dasenCoding 请解决下冲突

@dasenCoding
Copy link
Contributor Author

dasenCoding commented Nov 14, 2022

@dasenCoding 请解决下冲突

冲突已解决。
抱歉,处理冲突还不熟练,耽搁时间久了点。

@luotao1
Copy link
Contributor

luotao1 commented Nov 28, 2022

2022-11-25 10:56:24 Your PR code style check failed.
2022-11-25 10:56:24 Please install pre-commit locally and set up git hook scripts:
2022-11-25 10:56:24 
2022-11-25 10:56:24     pip install pre-commit==2.17.0
2022-11-25 10:56:24     pre-commit install
2022-11-25 10:56:24 
2022-11-25 10:56:24 Then, run pre-commit to check codestyle issues in your PR:
2022-11-25 10:56:24 
2022-11-25 10:56:24     pre-commit run --files python/paddle/distribution/kl.py python/paddle/distribution/multivariate_normal.py
2022-11-25 10:56:24 

PR-CI-Codestyle-Check 流水线没有过,请按照提示修改下代码格式。

@dasenCoding
Copy link
Contributor Author

dasenCoding commented Nov 30, 2022

2022-11-25 10:56:24 Your PR code style check failed.
2022-11-25 10:56:24 Please install pre-commit locally and set up git hook scripts:
2022-11-25 10:56:24 
2022-11-25 10:56:24     pip install pre-commit==2.17.0
2022-11-25 10:56:24     pre-commit install
2022-11-25 10:56:24 
2022-11-25 10:56:24 Then, run pre-commit to check codestyle issues in your PR:
2022-11-25 10:56:24 
2022-11-25 10:56:24     pre-commit run --files python/paddle/distribution/kl.py python/paddle/distribution/multivariate_normal.py
2022-11-25 10:56:24 

PR-CI-Codestyle-Check 流水线没有过,请按照提示修改下代码格式。

好的,感谢!但api 部分代码还未完成,可能需要完成后再整体修改代码格式。

@paddle-bot
Copy link

paddle-bot bot commented Dec 4, 2022

很抱歉,经过我们的反复讨论,你的PR暂未达到合入标准,请阅读飞桨原生算子开发规范,你可以重新提交新的PR,我们先将此PR关闭,感谢你的贡献。
Sorry to inform you that through our discussion, your PR fails to meet the merging standard (Reference: Paddle Custom Operator Design Doc). You can also submit an new one. Thank you.

@dasenCoding dasenCoding reopened this Dec 4, 2022
@luotao1
Copy link
Contributor

luotao1 commented Dec 20, 2022

PR 如果可以 review 了,请@我

@luotao1
Copy link
Contributor

luotao1 commented Jan 10, 2023

Coverage流水线中的test_dygraph_sharding_stage3_for_eager (Failed)是随机挂,可以忽略。请问这个 PR 可以进入 review 环节了么? @dasenCoding

@dasenCoding
Copy link
Contributor Author

Coverage流水线中的test_dygraph_sharding_stage3_for_eager (Failed)是随机挂,可以忽略。请问这个 PR 可以进入 review 环节了么? @dasenCoding

API 已经完成了,除了您刚才提到的 Coverage,有两个CI 检查没有通过,需要全部通过再进行 review 吗?

@luotao1
Copy link
Contributor

luotao1 commented Jan 10, 2023

API 已经完成了,除了您刚才提到的 Coverage,有两个CI 检查没有通过,需要全部通过再进行 review 吗?

不用,PR-CI-Static-Check是需要approve的,PR-CI-Build-ALLFramework-Compile是非required流水线,可以暂时不用关注。

@cxxly 可以帮忙 review 了~

@dasenCoding
Copy link
Contributor Author

API 已经完成了,除了您刚才提到的 Coverage,有两个CI 检查没有通过,需要全部通过再进行 review 吗?

不用,PR-CI-Static-Check是需要approve的,PR-CI-Build-ALLFramework-Compile是非required流水线,可以暂时不用关注。

@cxxly 可以帮忙 review 了~

好的,谢谢哈!

@dasenCoding
Copy link
Contributor Author

dasenCoding commented Jan 10, 2023

@cxxly 麻烦您 review 一下。


def __init__(self, loc, covariance_matrix):
if loc.dim() < 1:
raise ValueError("loc must be at least one-dimensional.")
Copy link
Contributor

Choose a reason for hiding this comment

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

len(loc.shape)

if loc.dim() < 1:
raise ValueError("loc must be at least one-dimensional.")
if (covariance_matrix is not None) != 1:
raise ValueError("Exactly covariance_matrix may be specified.")
Copy link
Contributor

Choose a reason for hiding this comment

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

if (covariance_matrix is not None) != 1 这句话的语义是? if covariance_matrix is None ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

对,是 if covariance_matrix is None 的意思。

return paddle.reshape(reshaped_M, bx_batch_shape)

def _extend_shape(self, sample_shape):
"""Compute shape of the sample
Copy link
Contributor

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.

好的。

@cxxly
Copy link
Contributor

cxxly commented Jan 13, 2023

参考已有分布,补充单测

@dasenCoding
Copy link
Contributor Author

参考已有分布,补充单测

好的。

@luotao1
Copy link
Contributor

luotao1 commented Feb 1, 2023

@dasenCoding 请解决下Coverage流水线单测覆盖率不足的问题

@dasenCoding
Copy link
Contributor Author

@dasenCoding 请解决下Coverage流水线单测覆盖率不足的问题

好的!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants