Skip to content
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.2】modify laplace2d to hydra style #575

Merged
merged 8 commits into from
Oct 19, 2023

Conversation

xusuyong
Copy link
Contributor

@xusuyong xusuyong commented Oct 18, 2023

PR types

Others

PR changes

Others

Describe

laplace2d 案例代码重构

@paddle-bot
Copy link

paddle-bot bot commented Oct 18, 2023

Thanks for your contribution!

@CLAassistant
Copy link

CLAassistant commented Oct 18, 2023

CLA assistant check
All committers have signed the CLA.

@paddle-bot
Copy link

paddle-bot bot commented Oct 18, 2023

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

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
Collaborator

Choose a reason for hiding this comment

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

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

mode: train # running mode: train/eval
seed: 42
output_dir: ${hydra:run.dir}
#log_freq: 20
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个不用注释吧

NPOINT_BC: 400

# model settings
model:
Copy link
Collaborator

Choose a reason for hiding this comment

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

model大写

Comment on lines 53 to 54
NPOINT_INTERIOR = cfg.NPOINT_INTERIOR
NPOINT_BC = cfg.NPOINT_BC
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里两行可以删除,

# set random seed for reproducibility
ppsci.utils.misc.set_random_seed(cfg.seed)

# # set output directory
Copy link
Collaborator

Choose a reason for hiding this comment

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

删除多余井号#

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
Collaborator

Choose a reason for hiding this comment

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

eval.log

equation = {"laplace": ppsci.equation.Laplace(dim=2)}

# set geometry
geom = {"rect": ppsci.geometry.Rectangle((0.0, 0.0), (1.0, 1.0))}
Copy link
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 on lines 157 to 159
NPOINT_INTERIOR = cfg.NPOINT_INTERIOR
NPOINT_BC = cfg.NPOINT_BC
NPOINT_TOTAL = NPOINT_INTERIOR + NPOINT_BC
Copy link
Collaborator

Choose a reason for hiding this comment

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

修改同上



if __name__ == "__main__":
main()
Copy link
Collaborator

Choose a reason for hiding this comment

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

文件末尾换行

--8<--
examples/laplace/laplace2d.py:115:
examples/laplace/laplace2d.py:110:130:
Copy link
Collaborator

Choose a reason for hiding this comment

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

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

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
Collaborator

Choose a reason for hiding this comment

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

加一下红框里的配置:
image

=== "模型训练命令"

``` sh
tar -xvf laplace2d_dataset.tar
Copy link
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

Copy link
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
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
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants