Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Doc] Add description of yaml #774

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

Merged

Conversation

HydrogenSulfate
Copy link
Collaborator

PR types

Others

PR changes

Docs

Describe

  1. 添加 yaml 的撰写教程
  2. 优化几处文档

@PaddlePaddle PaddlePaddle locked and limited conversation to collaborators Jan 29, 2024
@PaddlePaddle PaddlePaddle unlocked this conversation Jan 29, 2024

将已有的代码修改成配置文件控制的方式非常简单,只需要将必要的参数写到 `yaml` 文件中,然后通过 hydra 在程序运行时读取、解析该文件,通过其内容控制实验运行即可,以 `bracket` 案例为例,具体包含以下几个步骤。

1. 则需在代码文件 `bracket.py` 所在目录下新建 `conf` 文件夹,并在 `conf` 下新建与 `bracket.py` 同名的 `viv.yaml` 文件,如下所示。
Copy link
Collaborator

Choose a reason for hiding this comment

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

应该是是 viv.py 吧

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

已修改

└── viv.yaml
```

2. 将 `viv.py` 中必要的超参数按照其语义填写到 `viv.yaml` 的各个层级的配置中,如 `mode`、`output_dir`、`seed`、方程参数、文件路径等参数为通用参数,直接填写在一级层级;而模型结构参数、训练轮数等参数则只与模型、训练相关,只需分别填写在 `MODEL`、`TRAIN` 层级下即可(`EVAL` 层级同理)。
Copy link
Collaborator

Choose a reason for hiding this comment

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

这样更通顺些

如通用参数 `mode`、`output_dir`、`seed`、方程参数、文件路径等,直接填写在一级层级

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

已修改

Copy link
Collaborator

@zhiminzhang0830 zhiminzhang0830 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhiminzhang0830 zhiminzhang0830 merged commit e86d4dd into PaddlePaddle:develop Jan 31, 2024
@HydrogenSulfate HydrogenSulfate deleted the add_descrip_of_yaml branch May 8, 2024 09:24
huohuohuohuohuo123 pushed a commit to huohuohuohuohuo123/PaddleScience that referenced this pull request Aug 12, 2024
* (WIP)fix doctest and refine document

* update docs

* fix wrong code in ldc2d

* update code

* update paranoma

* fix

* refine doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants