Skip to content

【hydra No.2】modify laplace2d to hydra style#575

Merged
HydrogenSulfate merged 8 commits into
PaddlePaddle:developfrom
xusuyong:develop
Oct 19, 2023
Merged

【hydra No.2】modify laplace2d to hydra style#575
HydrogenSulfate merged 8 commits into
PaddlePaddle:developfrom
xusuyong:develop

Conversation

@xusuyong
Copy link
Copy Markdown
Contributor

@xusuyong xusuyong commented Oct 18, 2023

PR types

Others

PR changes

Others

Describe

laplace2d 案例代码重构

@paddle-bot
Copy link
Copy Markdown

paddle-bot Bot commented Oct 18, 2023

Thanks for your contribution!

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Oct 18, 2023

CLA assistant check
All committers have signed the CLA.

@paddle-bot
Copy link
Copy Markdown

paddle-bot Bot commented Oct 18, 2023

✅ This PR's description meets the template requirements!
Please wait for other CI results.

Comment thread docs/zh/examples/laplace2d.md Outdated
Comment on lines +8 to +13
# 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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这个模型没有来自文件的数据集,可以删除除最后一行外的代码

Comment thread examples/laplace/conf/laplace2d.yaml Outdated
mode: train # running mode: train/eval
seed: 42
output_dir: ${hydra:run.dir}
#log_freq: 20
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这个不用注释吧

Comment thread examples/laplace/conf/laplace2d.yaml Outdated
NPOINT_BC: 400

# model settings
model:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

model大写

Comment thread examples/laplace/laplace2d.py Outdated
Comment on lines +53 to +54
NPOINT_INTERIOR = cfg.NPOINT_INTERIOR
NPOINT_BC = cfg.NPOINT_BC
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这里两行可以删除,

Comment thread examples/laplace/laplace2d.py Outdated
Comment thread examples/laplace/laplace2d.py Outdated
# set random seed for reproducibility
ppsci.utils.misc.set_random_seed(cfg.seed)

# # set output directory
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

删除多余井号#

Comment thread 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")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

eval.log

Comment thread 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))}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

使用cfg.DIAGONAL_COORD作为几何参数

Comment thread examples/laplace/laplace2d.py Outdated
Comment on lines +157 to +159
NPOINT_INTERIOR = cfg.NPOINT_INTERIOR
NPOINT_BC = cfg.NPOINT_BC
NPOINT_TOTAL = NPOINT_INTERIOR + NPOINT_BC
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

修改同上

Comment thread examples/laplace/laplace2d.py Outdated


if __name__ == "__main__":
main() No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

文件末尾换行

Comment thread docs/zh/examples/laplace2d.md Outdated
``` py linenums="110"
--8<--
examples/laplace/laplace2d.py:115:
examples/laplace/laplace2d.py:110:130:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

改成英文冒号,否则无法渲染
image

Comment thread 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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

加一下红框里的配置:
image

Comment thread docs/zh/examples/laplace2d.md Outdated
=== "模型训练命令"

``` sh
tar -xvf laplace2d_dataset.tar
Copy link
Copy Markdown
Collaborator

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

Comment thread examples/laplace/laplace2d.py
Comment thread examples/laplace/laplace2d.py
Copy link
Copy Markdown
Collaborator

@HydrogenSulfate HydrogenSulfate left a comment

Choose a reason for hiding this comment

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

LGTM

@HydrogenSulfate HydrogenSulfate merged commit 1f3955f into PaddlePaddle:develop Oct 19, 2023
@luotao1
Copy link
Copy Markdown
Collaborator

luotao1 commented Nov 2, 2023

hi, @xusuyong

  • 非常感谢你对飞桨框架的贡献,我们正在运营一个PFCC组织,会通过定期分享技术知识与发布开发者主导任务的形式持续为飞桨框架做贡献,详情可见 https://github.com/luotao1 主页说明。
  • 如果你对PFCC有兴趣,请发送邮件至 ext_paddle_oss@baidu.com,我们会邀请你加入~

@HydrogenSulfate HydrogenSulfate changed the title modify laplace2d to hydra style 【hydra No.2】modify laplace2d to hydra style Nov 4, 2023
huohuohuohuohuo123 pushed a commit to huohuohuohuohuo123/PaddleScience that referenced this pull request Aug 12, 2024
* 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
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.

4 participants