Skip to content

【Hackathon 8th No.16】 data_efficient_nopt 论文复现 #1111

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

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
40 changes: 40 additions & 0 deletions examples/data_efficient_nopt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Usage

## 1. Data Download

数据来源参考如下。

|dataset| model | size| link |
|---|---|---|---|
|possion_64|Poisson (FNO)|6.2GB|https://drive.google.com/drive/folders/1crIsTZGxZULWhrXkwGDiWF33W6RHxJkf|
|helmholtz_64|Helmholtz (FNO)|5.8GB|https://drive.google.com/drive/folders/1UjIaF6FsjmN_xlGGSUX-1K2V3EF2Zalw|

## 2. Pretraining

修改`config/operators_possion.yaml`或`config/operators_helmholtz.yaml`相关文件夹路径。

修改`run_pretrain.sh`中config路径,采用`possion_64`或`helmholtz_64`配置,同时指定`--config`预训练配置。

```shell
bash run_pretrain.py
```

## 3. Fine-tuning

修改`config/operators_possion.yaml`或`config/operators_helmholtz.yaml`相关文件夹路径。

修改`run_pretrain.sh`中config路径,采用`possion_64`或`helmholtz_64`配置,同时指定`--config`微调配置。

```shell
bash run_pretrain.py
```

## 4. In-context Learning

修改`config/inference_poisson.yaml`或`config/inference_helmholtz.yaml`相关文件夹路径。

修改`run_pretrain.sh`中config路径,采用`possion_64`或`helmholtz_64`配置,同时指定`--ckpt`权重路径。

```shell
bash run_inference_possion.py
```
42 changes: 42 additions & 0 deletions examples/data_efficient_nopt/config/inference_helmholtz.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
default:
train_path: '/home/aistudio/data_efficient_nopt/data/helmholtz_64/helmholtz_64/helmholtz_64_o15_20_train.h5'
test_path: '/home/aistudio/data_efficient_nopt/data/helmholtz_64/helmholtz_64/helmholtz_64_o15_20_test.h5'
# scales_path: '/home/aistudio/data_efficient_nopt/data/helmholtz_64/helmholtz_64/helmholtz_64_o15_20_train_scale.npy'
# datapath: '/home/aistudio/data_efficient_nopt/data/helmholtz_64/helmholtz_64/helmholtz_64_o16_test.h5'
# datapath: '/home/aistudio/data_efficient_nopt/data/helmholtz_64/helmholtz_64/helmholtz_64_o15_test.h5'
# datapath: '/home/aistudio/data_efficient_nopt/data/helmholtz_64/helmholtz_64/helmholtz_64_o16_tensor15_test.h5'
# datapath: '/home/aistudio/data_efficient_nopt/data/helmholtz_64/helmholtz_64/helmholtz_64_o5_15_test.h5'
scales_path: '/home/aistudio/data_efficient_nopt/data/helmholtz_64/helmholtz_64/helmholtz_64_o5_15_train_scale.npy'

num_data_workers: 1
subsample: 1
# num_demos: 0
shuffle: False
nx: 64
nt: 64
Lx: !!float 1.0
Ly: !!float 1.0
pack_data: !!bool False

model: 'fno'
layers: [64, 64, 64, 64, 64]
modes1: [65, 65, 65, 65]
modes2: [65, 65, 65, 65]
fc_dim: 128

in_dim: 3
out_dim: 1
mode_cut: 32
embed_cut: 64
fc_cut: 2
dropout: 0

fix_backbone: True

loss_func: mse

batch_size: 1
loss_style: sum

log_to_wandb: !!bool False
logdir: ./log
39 changes: 39 additions & 0 deletions examples/data_efficient_nopt/config/inference_poisson.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
default:
# datapath: '/home/aistudio/data_efficient_nopt/data/possion_64/poisson_64_e5_15_test.h5'
train_path: '/home/aistudio/data_efficient_nopt/data/possion_64/poisson_64_e15_50_train.h5' # pick demos
test_path: '/home/aistudio/data_efficient_nopt/data/possion_64/poisson_64_e15_50_test.h5'
# datapath: '/home/aistudio/data_efficient_nopt/data/possion_64/poisson_64_e20_test.h5'
scales_path: '/home/aistudio/data_efficient_nopt/data/possion_64/poisson_64_e5_15_train_scale.npy'

num_data_workers: 1
subsample: 1
# num_demos: 0
shuffle: False
nx: 64
nt: 64
Lx: !!float 1.0
Ly: !!float 1.0
pack_data: !!bool False

model: 'fno'
layers: [64, 64, 64, 64, 64]
modes1: [65, 65, 65, 65]
modes2: [65, 65, 65, 65]
fc_dim: 128

in_dim: 4
out_dim: 1
mode_cut: 32
embed_cut: 64
fc_cut: 2
dropout: 0

fix_backbone: True

loss_func: mse

batch_size: 1
loss_style: sum

log_to_wandb: !!bool False
logdir: ./log
Loading