-
Notifications
You must be signed in to change notification settings - Fork 233
【hydra No.2】modify laplace2d to hydra style #575
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
Conversation
|
Thanks for your contribution! |
|
✅ This PR's description meets the template requirements! |
docs/zh/examples/laplace2d.md
Outdated
| # linux | ||
| wget https://paddle-org.bj.bcebos.com/paddlescience/datasets/laplace2d/laplace2d_dataset.tar | ||
| # windows | ||
| # curl https://paddle-org.bj.bcebos.com/paddlescience/datasets/laplace2d/laplace2d_dataset.tar --output laplace2d_dataset.tar | ||
| # unzip it | ||
| tar -xvf laplace2d_dataset.tar |
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.
这个模型没有来自文件的数据集,可以删除除最后一行外的代码
examples/laplace/conf/laplace2d.yaml
Outdated
| mode: train # running mode: train/eval | ||
| seed: 42 | ||
| output_dir: ${hydra:run.dir} | ||
| #log_freq: 20 |
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.
这个不用注释吧
examples/laplace/conf/laplace2d.yaml
Outdated
| NPOINT_BC: 400 | ||
|
|
||
| # model settings | ||
| model: |
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.
model大写
examples/laplace/laplace2d.py
Outdated
| NPOINT_INTERIOR = cfg.NPOINT_INTERIOR | ||
| NPOINT_BC = cfg.NPOINT_BC |
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.
这里两行可以删除,
examples/laplace/laplace2d.py
Outdated
| # set random seed for reproducibility | ||
| ppsci.utils.misc.set_random_seed(cfg.seed) | ||
|
|
||
| # # set output directory |
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.
删除多余井号#
examples/laplace/laplace2d.py
Outdated
| ppsci.utils.misc.set_random_seed(cfg.seed) | ||
|
|
||
| # # set output directory | ||
| logger.init_logger("ppsci", osp.join(cfg.output_dir, "train.log"), "info") |
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.
eval.log
examples/laplace/laplace2d.py
Outdated
| equation = {"laplace": ppsci.equation.Laplace(dim=2)} | ||
|
|
||
| # set geometry | ||
| geom = {"rect": ppsci.geometry.Rectangle((0.0, 0.0), (1.0, 1.0))} |
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.DIAGONAL_COORD作为几何参数
examples/laplace/laplace2d.py
Outdated
| NPOINT_INTERIOR = cfg.NPOINT_INTERIOR | ||
| NPOINT_BC = cfg.NPOINT_BC | ||
| NPOINT_TOTAL = NPOINT_INTERIOR + NPOINT_BC |
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.
修改同上
examples/laplace/laplace2d.py
Outdated
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
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.
文件末尾换行
docs/zh/examples/laplace2d.md
Outdated
| ``` py linenums="110" | ||
| --8<-- | ||
| examples/laplace/laplace2d.py:115: | ||
| examples/laplace/laplace2d.py:110:130: |
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.
examples/laplace/conf/laplace2d.yaml
Outdated
| dir: output_laplace2d/${now:%Y-%m-%d}/${now:%H-%M-%S}/${hydra.job.override_dirname} | ||
| job: | ||
| name: ${mode} # name of logfile | ||
| chdir: false # keep current working direcotry unchaned |
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.
docs/zh/examples/laplace2d.md
Outdated
| === "模型训练命令" | ||
|
|
||
| ``` sh | ||
| tar -xvf laplace2d_dataset.tar |
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.
删除tar -xvf laplace2d_dataset.tar
HydrogenSulfate
left a comment
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
|
hi, @xusuyong
|
* modify laplace2d to hydra style * modify laplace2d to hydra style * modify laplace2d to hydra style * modify laplace2d to hydra style * modify laplace2d to hydra style * modify laplace2d to hydra style * fix


PR types
Others
PR changes
Others
Describe
laplace2d 案例代码重构