-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
【hydra No.6】cylinder2d_unsteady #624
Conversation
Thanks for your contribution! |
❌ The PR is not created using PR's template. You can refer to this Demo. |
=== "模型评估命令" | ||
|
||
``` sh | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
评估命令可以先删除
@@ -2,6 +2,16 @@ | |||
|
|||
<a href="https://aistudio.baidu.com/aistudio/projectdetail/6160381?contributionType=1&sUid=438690&shared=1&ts=1683961158552" class="md-button md-button--primary" style>AI Studio快速体验</a> | |||
|
|||
=== "模型训练命令" | |||
|
|||
``` sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# linux
wget https://paddle-org.bj.bcebos.com/paddlescience/datasets/cylinder2d_unsteady_Re100/cylinder2d_unsteady_Re100_dataset.tar
# windows
# curl https://paddle-org.bj.bcebos.com/paddlescience/datasets/cylinder2d_unsteady_Re100/cylinder2d_unsteady_Re100_dataset.tar --output cylinder2d_unsteady_Re100_dataset.tar
# unzip it
tar -xvf bracket_dataset.tar
python cylinder2d_unsteady_Re100.py
|
||
# set equation | ||
equation = {"NavierStokes": ppsci.equation.NavierStokes(0.02, 1.0, 2, True)} | ||
equation = { | ||
"NavierStokes": ppsci.equation.NavierStokes(cfg.viscosity, cfg.density, 2, True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==> cfg.VISCOSITY, cfg.DENSITY
NPOINT_PDE, NTIME_PDE = 9420, len(train_timestamps) | ||
NPOINT_INLET_CYLINDER = 161 | ||
NPOINT_OUTLET = 81 | ||
NPOINT_PDE = cfg.NPOINT_PDE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接使用cfg.NPOINT_PDE代替NPOINT_PDE
NPOINT_INLET_CYLINDER = cfg.NPOINT_INLET_CYLINDER | ||
NPOINT_OUTLET = cfg.NPOINT_OUTLET |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
"time_rect": ppsci.geometry.TimeXGeometry( | ||
ppsci.geometry.TimeDomain( | ||
cfg.TIME_START, | ||
cfg.TIME_END, | ||
timestamps=np.concatenate((t0, train_timestamps), axis=0), | ||
), | ||
ppsci.geometry.PointCloud( | ||
reader.load_csv_file( | ||
"./datasets/domain_train.csv", | ||
("x", "y"), | ||
alias_dict={"x": "Points:0", "y": "Points:1"}, | ||
), | ||
("x", "y"), | ||
), | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
time_rect
这个几何在评估函数中没有使用,可以删除
), | ||
"time_rect_eval": ppsci.geometry.PointCloud( | ||
reader.load_csv_file( | ||
"./datasets/domain_eval.csv", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
该路径使用cfg.DOMAIN_EVAL_PATH控制
DOMAIN_OUTLET_PATH: ./datasets/domain_outlet.csv | ||
IC0_1_PATH: ./datasets/initial/ic0.1.csv | ||
PROBE1_50_PATH: ./datasets/probe/probe1_50.csv | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
新增 # set validator data path
,存放DOMAIN_EVAL_PATH
OUTPUT_DIR, | ||
equation=equation, | ||
geom=geom, | ||
output_dir=cfg.output_dir, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加回geom=geom,
# evaluate after finished training | ||
solver.eval() | ||
# visualize prediction from pretrained_model_path(optional) | ||
# visualize prediction after finished training |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删除 after finished training
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* hydra No.6 * hydra 6 * hydra 6 * hydra 6 * Update docs/zh/examples/cylinder2d_unsteady.md --------- Co-authored-by: HydrogenSulfate <490868991@qq.com>
PR types
Others
PR changes
Others
Describe
#571
No.9 cylinder2d_unsteady
1、使用第三方库 hydra适配 cylinder2d_unsteady案例
2、cylinder2d_unsteady案例代码重构,添加评估函数 evaluate,及其训练/评估命令和预训练模型、指标