Skip to content

Commit 6bb53d9

Browse files
committed
feat(ppsci): support data_effient_nopt
1 parent 22c8eba commit 6bb53d9

10 files changed

+784
-776
lines changed

docs/zh/examples/data_efficient_nopt.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,11 @@
1515
# Download possion_64 data from https://drive.google.com/drive/folders/1crIsTZGxZULWhrXkwGDiWF33W6RHxJkf
1616
# Download helmholtz_64 data from https://drive.google.com/drive/folders/1UjIaF6FsjmN_xlGGSUX-1K2V3EF2Zalw
1717

18-
# Update the file paths in `cexamples/data_efficient_nopt/config/data_efficient_nopt.yaml`, specify to mode in `train`
19-
# UPdate the file paths in config/operators_poisson.yaml or config/operators_helmholtz.yaml, specify to `train_path`, `val_path`, `test_path`, `scales_path` and `train_rand_idx_path`
20-
21-
# possion_64 or helmholtz_64 pretrain, for example, specify as following:
22-
# run_name: r0
23-
# config: helm-64-pretrain-o1_20_m1
24-
# yaml_config: config/operators_helmholtz.yaml
25-
python data_efficient_nopt.py
26-
27-
# possion_64 or helmholtz_64 finetune, for example, specify as following:
28-
# run_name: r0
29-
# config: helm-64-o5_15_ft5_r2
30-
# yaml_config: config/operators_helmholtz.yaml
31-
python data_efficient_nopt.py
18+
# Update the file paths in `cexamples/data_efficient_nopt/config/data_efficient_nopt.yaml`, specify to mode in `train`, and then specify to `train_path`, `val_path`, `test_path`, `scales_path` and `train_rand_idx_path`
19+
20+
# pretrain or finetune, for possion_64 or helmholtz_64.
21+
# specify config_name to fno_possion using `data_efficient_nopt_fno_poisson`, or to fno_helmholtz using `data_efficient_nopt_fno_helmholtz`
22+
python data_efficient_nopt.py --config-name=<config_name>
3223
```
3324

3425
=== "模型评估命令"
@@ -43,17 +34,16 @@
4334

4435
``` sh
4536
cd examples/data_efficient_nopt
46-
# Update the file paths in `cexamples/data_efficient_nopt/config/data_efficient_nopt.yaml`, specify to mode in `infer`
37+
# Update the file paths in `cexamples/data_efficient_nopt/config/data_efficient_nopt.yaml`, specify to mode in `infer`, and then specify to `ckpt_path`, `train_path`, `test_path` and `scales_path`
4738
# Use a fine-tuned model as the checkpoint in 'exp' or utilize `model_convert.py` to convert the official checkpoint.
48-
# UPdate the file paths in config/inference_poisson.yaml or config/inference_poisson.yaml, specify to `train_path`, `test_path` and `scales_path`
4939

5040
# use your onw finetune checkpoints, or download checkpoint from [FNO-Poisson](https://drive.google.com/drive/folders/1ekmXqqvpaY6pNStTciw1SCAzF0gjFP_V) or [FNO-Helmholtz](https://drive.google.com/drive/folders/1k7US8ZAgB14Wj9bfdgO_Cjw6hOrG6UaZ) and then convert to paddlepaddle weights.
5141
python model_convert.py --pt-model <pt_checkpiont> --pd-model <pd_checkpiont>
5242

53-
# possion_64 inference, specify as following:
54-
# evaluation: config/inference_poisson.yaml
43+
# inference for possion_64 or helmholtz_64, specify in config as following:
5544
# ckpt_path: <ckpt_path>
56-
python data_efficient_nopt.py
45+
# specify config_name to fno_possion using `data_efficient_nopt_fno_poisson`, or to fno_helmholtz using `data_efficient_nopt_fno_helmholtz`
46+
python data_efficient_nopt.py --config-name=<config_name>
5747
```
5848

5949
## 1. 背景简介
@@ -89,6 +79,8 @@
8979

9080
为了解决上述问题,论文提出了一种创新性的数据高效神经算子学习框架,该框架主要由两个阶段组成:*无监督预训练**情境学习推理*
9181

82+
![fig1](https://dataset.bj.bcebos.com/PaddleScience/data_efficient_nopt/fig1.png)
83+
9284
#### 3.1 无监督预训练 (Unsupervised Pretraining)
9385

9486
无监督预训练的目标是在不使用昂贵PDE解数据的情况下,预先训练神经算子以学习物理相关的特征表示,为后续的监督微调提供一个良好的初始化。
@@ -161,6 +153,14 @@ examples/data_efficient_nopt/data_efficient_nopt.py
161153
- 无需训练开销:情境学习在推理阶段灵活地引入相似示例,且不增加任何训练成本。
162154
- 持续性能提升:实验证明,通过增加情境示例的数量,神经算子在各种PDE上的OOD泛化能力能够持续得到提升。这为在模型部署后动态提升其在复杂未知情况下的性能提供了可能。尤其是在解决OOD问题时,情境示例能够帮助模型校准输出的量级和模式,使其更接近真实解。
163155

156+
图2体现了在该方法下,在多种泛化场景下,数据效率使用的提升,有更好的收敛速度。
157+
158+
![fig2](https://dataset.bj.bcebos.com/PaddleScience/data_efficient_nopt/fig3.png)
159+
160+
图3体现该种方法在情景推理场景中,超越了现有的通用预训练模型,具有额外泛化优势。
161+
162+
![fig3](https://dataset.bj.bcebos.com/PaddleScience/data_efficient_nopt/fig6.png)
163+
164164
总而言之,这篇论文提出了一种创新且高效的神经算子学习框架,通过无监督预训练在大量廉价的无标签物理数据上学习通用表示,并通过情境学习在推理阶段利用少量相似案例来提升OOD泛化能力。这一框架显著降低了对昂贵模拟数据的需求,并提高了模型在复杂物理问题中的适应性和泛化性,为科学机器学习的数据高效发展开辟了新途径。
165165

166166
下方展示了部分实验结果:

examples/data_efficient_nopt/config/data_efficient_nopt.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)