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

【Hackathon No.71】为 PaddleScience 新增支持随机/Quasi采样法 #58

Merged
merged 6 commits into from
May 11, 2022
Merged

Conversation

AndPuQing
Copy link
Contributor

No description provided.

@paddle-bot-old
Copy link

PR格式检查通过,你的PR将接受Paddle专家以及开源社区的review,请及时关注PR动态。
The format inspection passed. Your PR will be reviewed by experts of Paddle and developers from the open-source community. Stay tuned.


## 增强采样

对于一些任务的特殊性,可以在采样时增强采样,如下采样点生成方式

Choose a reason for hiding this comment

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

除提及的增强采样外,能否支持如下图示(仅做局部增强效果参考)的局部增强随机采样?如2D圆柱绕流,圆周周边可以划定区域进行局部增强采。API参数中可以选择局部增强的方式,如中心方向区域、中心十字形区域类型,并能够分别定义局部增强的参数。
示例1:
image
示例2:
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.

您好,您说的效果可能需要73题目的支持(几何图形的布尔运算),但是最近我有点事情,回复会比较慢,但是我会继续完善该RFC,感谢您的REVIEW

Copy link

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.

你好,我为73题目以及71题目写了一个简单的demo,可以在此处查看Geometry
但是现阶段非常粗糙,运行效果在repo目录下的ipynb文件可以查看,希望您能给给意见,或者可以联系我的邮箱me@puqing.work


## DeepXDE

deepxde 在[sampler](https://github.com/lululxvi/deepxde/blob/master/deepxde/geometry/sampler.py)中实现了采样,支持 Pseudo random 采样与由 skopt.sampler 提供的 Quasi random 采样。
Copy link

@jkrescue jkrescue Mar 29, 2022

Choose a reason for hiding this comment

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

我们这里提到的准随机采样,是否也完全支持sampler中拉丁超立方、halton等序列?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

您好,scipy中也支持上述序列采样,具体参考scipy.stats.qmc,如下图是各种采样的对比
output
output1
output2

Copy link

Choose a reason for hiding this comment

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

好的,可以。


即像 deepxde 中 boundary_sampler 中单独对边缘采样。

第一种随机性过高,可能需要重复调整边界取点条件。所以推荐第二种方式。
Copy link

@jkrescue jkrescue Mar 29, 2022

Choose a reason for hiding this comment

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

可否对边界随机采样的点定义不同标识的set集合(eg: inlet_bc, outlet_bc, side_bc, circle_bc……),并在定义BC时,可直接选择不同标识的点集定义。 目的是能够保证几何尺寸变化后,随机点、边界条件等同步发生变化,放弃if判断的方法。

Copy link

Choose a reason for hiding this comment

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

这块可以考虑下是否有些好的想法哈

@AndPuQing
Copy link
Contributor Author

更新了关于增加Geometry、随机化采样、增强性采样我的想法,但是可能时间不足,无法完成,但是上述repo我会持续更新。感谢您的review

Copy link

@jkrescue jkrescue left a comment

Choose a reason for hiding this comment

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

大体路线可行,希望能够再完善下

@TCChenlong TCChenlong merged commit 19c3d74 into PaddlePaddle:master May 11, 2022
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