Skip to content
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

[Doc] update quick_start #751

Merged
merged 6 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/images/quickstart/u_pred_case1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/quickstart/u_pred_case2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@

=== "方式2: pip安装"

``` shell
``` sh
pip install paddlesci
```

Expand Down
8 changes: 4 additions & 4 deletions docs/zh/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ if __name__ == "__main__":

PaddleScience 内置了一些常见的模型,如 `MLP` 模型,如果您想使用这些内置的模型,可以直接调用 [`ppsci.arch.*`](./api/arch.md) 下的 API,并填入模型实例化所需的参数,即可快速构建模型。

``` py title="examples/demo/demo.py"
``` py title="examples/demo/demo.py"
# create a MLP model
model = ppsci.arch.MLP(("x", "y"), ("u", "v", "p"), 9, 50, "tanh")
```
Expand Down Expand Up @@ -638,7 +638,7 @@ solver.visualize()

文档撰写过程中需进行即时渲染,预览文档内容以检查撰写的内容是否有误。因此需要按照如下命令,安装 mkdocs 相关依赖包。

``` shell
``` sh
pip install -r docs/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
```

Expand All @@ -654,7 +654,7 @@ PaddleScience 文档基于 [Mkdocs-Material](https://squidfunk.github.io/mkdocs-

在 `PaddleScience/` 目录下执行以下命令,等待构建完成后,点击显示的链接进入本地网页预览文档内容。

``` shell
``` sh
mkdocs serve
```

Expand All @@ -673,7 +673,7 @@ mkdocs serve

若默认端口号 8000 被占用,则可以手动指定服务部署的地址和端口,示例如下。

``` shell
``` sh
# 指定 127.0.0.1 为地址,8687 为端口号
mkdocs serve -a 127.0.0.1:8687
```
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/examples/amgnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

执行以下命令,下载并解压数据集。

``` shell
``` sh
wget -nc https://paddle-org.bj.bcebos.com/paddlescience/datasets/AMGNet/data.zip
unzip data.zip
```
Expand Down
10 changes: 5 additions & 5 deletions docs/zh/examples/cfdgcn.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

执行以下命令,下载并解压数据集。

``` shell
``` sh
wget -nc https://paddle-org.bj.bcebos.com/paddlescience/datasets/CFDGCN/data.zip
unzip data.zip
wget -nc https://paddle-org.bj.bcebos.com/paddlescience/datasets/CFDGCN/meshes.tar
Expand All @@ -74,14 +74,14 @@ SU2 流体模拟器以预编译库的形式嵌入在网络中,我们需要下

执行以下命令,下载并解压预编译库。

``` shell
``` sh
wget -nc -P https://paddle-org.bj.bcebos.com/paddlescience/datasets/CFDGCN/SU2Bin.tgz
tar -zxvf SU2Bin.tgz
```

预编译库下载完成后,设置 SU2 的环境变量。

``` shell
``` sh
export SU2_RUN=/absolute_path/to/SU2Bin/
export SU2_HOME=/absolute_path/to/SU2Bin/
export PATH=$PATH:$SU2_RUN
Expand Down Expand Up @@ -172,9 +172,9 @@ examples/cfdgcn/cfdgcn.py:39:48

完成上述设置之后,只需要将上述实例化的对象按顺序传递给 `ppsci.solver.Solver`,然后启动训练。

``` py linenums="120"
``` py linenums="125"
--8<--
examples/cfdgcn/cfdgcn.py:126:140
examples/cfdgcn/cfdgcn.py:125:140
--8<--
```

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/examples/control_arm.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ examples/control_arm/conf/forward_analysis.yaml:61:63

训练过程会调用优化器来更新模型参数,此处选择较为常用的 `Adam` 优化器,并配合使用机器学习中常用的 ExponentialDecay 学习率调整策略。

``` py linenums="23"
``` py linenums="26"
--8<--
examples/control_arm/forward_analysis.py:26:30
--8<--
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/examples/deepcfd.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ $$u_x\frac{\partial u_y}{\partial x} + u_y\frac{\partial u_y}{\partial y} = - \f

运行本问题代码前请按照下方命令下载 [dataX](https://paddle-org.bj.bcebos.com/paddlescience/datasets/DeepCFD/dataX.pkl) 和 [dataY](https://paddle-org.bj.bcebos.com/paddlescience/datasets/DeepCFD/dataY.pkl):

``` shell
``` sh
wget -nc -P ./datasets/ https://paddle-org.bj.bcebos.com/paddlescience/datasets/DeepCFD/dataX.pkl
wget -nc -P ./datasets/ https://paddle-org.bj.bcebos.com/paddlescience/datasets/DeepCFD/dataY.pkl
```
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/examples/deephpms.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ examples/deephpms/burgers.py:157:173

第二阶段训练、评估

``` py linenums="218"
``` py linenums="221"
--8<--
examples/deephpms/burgers.py:221:237
--8<--
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/examples/hpinns.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ $$

运行本问题代码前请按照下方命令下载 [训练数据集](https://paddle-org.bj.bcebos.com/paddlescience/datasets/hPINNs/hpinns_holo_train.mat) 和 [验证数据集](https://paddle-org.bj.bcebos.com/paddlescience/datasets/hPINNs/hpinns_holo_valid.mat):

``` shell
``` sh
wget -nc -P ./datasets/ https://paddle-org.bj.bcebos.com/paddlescience/datasets/hPINNs/hpinns_holo_train.mat
wget -nc -P ./datasets/ https://paddle-org.bj.bcebos.com/paddlescience/datasets/hPINNs/hpinns_holo_valid.mat
```
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/examples/phylstm.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ DeepPhyLSTM 参数 input_size 是输入大小,output_size 是输出大小,hi

运行本问题代码前请按照下方命令下载 [data_boucwen.mat](https://paddle-org.bj.bcebos.com/paddlescience/datasets/PhyLSTM/data_boucwen.mat)

``` shell
``` sh
wget -nc -P ./ https://paddle-org.bj.bcebos.com/paddlescience/datasets/PhyLSTM/data_boucwen.mat
```

Expand Down
10 changes: 5 additions & 5 deletions docs/zh/examples/rossler.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ examples/rossler/conf/enn.yaml:22:34

本案例基于数据驱动的方法求解问题,因此需要使用 PaddleScience 内置的 `SupervisedConstraint` 构建监督约束。在定义约束之前,需要首先指定监督约束中用于数据加载的各个参数,代码如下:

``` py linenums="57" title="examples/rossler/train_enn.py"
``` py linenums="55" title="examples/rossler/train_enn.py"
--8<--
examples/rossler/train_enn.py:55:74
--8<--
Expand Down Expand Up @@ -129,9 +129,9 @@ examples/rossler/train_enn.py:76:86

用 PaddleScience 代码表示如下:

``` py linenums="89" title="examples/rossler/train_enn.py"
``` py linenums="92" title="examples/rossler/train_enn.py"
--8<--
examples/rossler/train_enn.py:93:99
examples/rossler/train_enn.py:92:99
--8<--
```

Expand Down Expand Up @@ -189,9 +189,9 @@ examples/rossler/conf/transformer.yaml:23:34

Transformer 模型同样基于数据驱动的方法求解问题,因此需要使用 PaddleScience 内置的 `SupervisedConstraint` 构建监督约束。在定义约束之前,需要首先指定监督约束中用于数据加载的各个参数,代码如下:

``` py linenums="67" title="examples/rossler/train_transformer.py"
``` py linenums="64" title="examples/rossler/train_transformer.py"
--8<--
examples/rossler/train_transformer.py:65:82
examples/rossler/train_transformer.py:64:82
--8<--
```

Expand Down
8 changes: 4 additions & 4 deletions docs/zh/install_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ pybind11、pysdf、PyMesh 四个依赖库。

- 执行以下代码,验证安装的 PaddleScience 基础功能是否正常。

``` shell
``` sh
python -c "import ppsci; ppsci.run_check()"
```

Expand All @@ -170,7 +170,7 @@ pybind11、pysdf、PyMesh 四个依赖库。
- [可选]如果已按照 [1.4.2 安装额外依赖](#142) 正确安装了 4 个额外依赖库,则可以执行以下代码,
验证 PaddleScience 的 `ppsci.geometry.Mesh` 模块是否能正常运行。

``` shell
``` sh
python -c "import ppsci; ppsci.run_check_mesh()"
```

Expand All @@ -180,7 +180,7 @@ pybind11、pysdf、PyMesh 四个依赖库。

- 运行内置的案例(以 **ldc2d_unsteady_Re10.py** 为例)

``` shell
``` sh
cd examples/ldc/
python ./ldc2d_unsteady_Re10.py
```
Expand All @@ -197,7 +197,7 @@ pybind11、pysdf、PyMesh 四个依赖库。

编写完毕后运行你的代码

``` shell
``` sh
cd examples/demo
python ./demo.py
```
Expand Down
Loading