Skip to content

Commit 4eb1b7a

Browse files
add pics for overview.md
1 parent 71e3acd commit 4eb1b7a

File tree

9 files changed

+20
-17
lines changed

9 files changed

+20
-17
lines changed

docs/images/overview/constraint.jpg

92.1 KB
Loading

docs/images/overview/equation.jpg

132 KB
Loading

docs/images/overview/geometry.jpg

108 KB
Loading

docs/images/overview/workflow.jpg

219 KB
Loading

docs/overview.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
# PaddleScience 模块介绍
22

3-
PaddleScience 在代码结构上划分为 12 个模块。从一般深度学习工作流的角度来看,这 12 个模块分别负责构建输入数据、构建神经网络模型、构建损失函数、构建优化器,训练、评估、可视化等功能。从科学计算角度来看,部分模块承担了不同于 CV、NLP 任务的功能,比如用于物理机理驱动的 Equation 模块,定义方程公式和辅助高阶微分计算;用于涉及几何场景采样的 Geometry 模块,定义简单、复杂几何形状并在其内部、边界采样构造数据;Constraint 模块将不同的优化目标视为一种“约束”,使得套件能用一套训练代码统一物理机理驱动(无监督训练)、数据驱动(监督训练)、数理融合(半监督训练)三种不同的求解流程
3+
PaddleScience 在代码结构上划分为 12 个模块。从一般深度学习工作流的角度来看,这 12 个模块分别负责构建输入数据、构建神经网络模型、构建损失函数、构建优化器,训练、评估、可视化等功能。从科学计算角度来看,部分模块承担了不同于 CV、NLP 任务的功能,比如用于物理机理驱动的 Equation 模块,定义方程公式和辅助高阶微分计算;用于涉及几何场景采样的 Geometry 模块,定义简单、复杂几何形状并在其内部、边界采样构造数据;Constraint 模块将不同的优化目标视为一种“约束”,使得套件能用一套训练代码统一物理机理驱动、数据驱动、数理融合三种不同的求解流程
44

55
## 1. 整体工作流
66

77
<figure markdown>
8-
![TODO](workflow.jpg){ loading=lazy }
9-
<figcaption> workflow of PaddleScience </figcaption>
8+
![workflow](./images/overview/workflow.jpg){ loading=lazy style="height:80%;width:80%"}
109
</figure>
1110

1211
## 2. 模块简介
1312

14-
<figure markdown>
15-
![TODO](modules.jpg){ loading=lazy }
16-
<figcaption> Relation of different modules </figcaption>
17-
</figure>
18-
1913
### 2.1 [Arch](./zh/api/arch.md)
2014

2115
Arch 模块负责各种神经网络模型的组网、参数初始化、前向计算等功能,内置了多种模型供用户使用。
@@ -26,6 +20,10 @@ AutoDiff 模块负责计算高阶微分功能,内置基于 Paddle 自动微分
2620

2721
### 2.3 [Constraint](./zh/api/constraint.md)
2822

23+
<figure markdown>
24+
![constraint](./images/overview/constraint.jpg){ loading=lazy style="height:50%;width:50%"}
25+
</figure>
26+
2927
为了在套件中统一物理信息驱动、数据驱动、数理融合三种求解方式,我们将数据构造、输入到输出的计算过程、损失函数等必要接口在其定义完毕之后,统一记录在 Constraint 这一模块中,有了这些接口,Constraint 就能表示不同的训练目标,如:
3028

3129
- `InteriorConstraint` 定义了在给定的几何区域内部,按照给定输入到输出的计算过程,利用损失函数优化模型参数,使得模型输出满足给定的条件;
@@ -53,10 +51,18 @@ BatchTransform 模块存放各种基于批样本的数据预处理方法。
5351

5452
### 2.5 [Equation](./zh/api/equation.md)
5553

54+
<figure markdown>
55+
![equation](./images/overview/equation.jpg){ loading=lazy style="height:80%;width:80%" align="center" }
56+
</figure>
57+
5658
Equation 模块负责定义各种常见方程的计算函数,如 `NavierStokes` 表示 N-S 方程,`Vibration` 表示振动方程,每个方程内部含有相关变量的计算函数。
5759

5860
### 2.6 [Geometry](./zh/api/geometry.md)
5961

62+
<figure markdown>
63+
![geometry](./images/overview/geometry.jpg#center){ loading=lazy style="height:50%;width:50%" }
64+
</figure>
65+
6066
Geometry 模块负责定义各种常见的几何形状,如 `Interval` 线段几何、`Rectangle` 矩形几何、`Sphere` 球面几何。
6167

6268
### 2.7 [Loss](./zh/api/loss.md)

mkdocs.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ site_description: An out-of-the-box open source library for scientific computing
1818
site_author: PaddlePaddle
1919
site_url: "https://github.com/PaddlePaddle/PaddleScience"
2020
strict: false
21-
edit_uri: edit/main/docs # 编辑按钮跳转的链接
2221

2322
# Repository
2423
repo_name: PaddleScience
@@ -32,7 +31,7 @@ nav:
3231
- PaddleScience:
3332
- 主页: index.md
3433
- 功能介绍: overview.md
35-
- 开始使用: install_setup.md
34+
- 安装使用: install_setup.md
3635
- 经典案例:
3736
- PINNs:
3837
- ViV: zh/examples/viv.md
@@ -144,7 +143,6 @@ extra_javascript:
144143
# Extra css
145144
extra_css:
146145
- stylesheets/extra.css
147-
- stylesheets/monokai.css
148146

149147
# Extra
150148
extra:

ppsci/solver/eval.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,17 @@
1818
import paddle.amp as amp
1919
import paddle.io as io
2020

21-
from ppsci import solver
2221
from ppsci.solver import printer
2322
from ppsci.utils import expression
2423
from ppsci.utils import misc
2524
from ppsci.utils import profiler
2625

2726

28-
def eval_func(solver: solver.Solver, epoch_id: int, log_freq: int) -> float:
27+
def eval_func(solver, epoch_id: int, log_freq: int) -> float:
2928
"""Evaluation program
3029
3130
Args:
32-
solver (Solver): Main Solver.
31+
solver (solver.Solver): Main Solver.
3332
epoch_id (int): Epoch id.
3433
log_freq (int): Log evaluation information every `log_freq` steps.
3534

ppsci/solver/train.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from ppsci.utils import profiler
2424

2525

26-
def train_epoch_func(solver: solver.Solver, epoch_id: int, log_freq: int):
26+
def train_epoch_func(solver, epoch_id: int, log_freq: int):
2727
"""Train program for one epoch
2828
2929
Args:
@@ -113,7 +113,7 @@ def train_epoch_func(solver: solver.Solver, epoch_id: int, log_freq: int):
113113
batch_tic = time.perf_counter()
114114

115115

116-
def train_LBFGS_epoch_func(solver: solver.Solver, epoch_id: int, log_freq: int):
116+
def train_LBFGS_epoch_func(solver, epoch_id: int, log_freq: int):
117117
"""Train function for one epoch with L-BFGS optimizer.
118118
119119
Args:

ppsci/solver/visu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525

2626
@paddle.no_grad()
27-
def visualize_func(solver: solver.Solver, epoch_id: int):
27+
def visualize_func(solver, epoch_id: int):
2828
"""Visualization program
2929
3030
Args:

0 commit comments

Comments
 (0)