Skip to content

Commit

Permalink
[Fea] Add poisson1d for gPINN algorithm and fix LBFGS initialization …
Browse files Browse the repository at this point in the history
…for compatible (PaddlePaddle#682)

* update gPINN code

* fix for compatible with legacy version of paddle

* update poisson1d config

* remove opencv-python from requiments for large pkg size and refine hint for missing opencv-python and fix document of nowcast

* remove opencv-python from requiments for large pkg size and refine hint for missing opencv-python and fix document of nowcast

* refine code with accurate configuration and add x/y label for u-x figure

* fix more

* fix
  • Loading branch information
HydrogenSulfate authored Dec 8, 2023
1 parent 5103f94 commit 9239eb8
Show file tree
Hide file tree
Showing 7 changed files with 415 additions and 5 deletions.
3 changes: 2 additions & 1 deletion docs/zh/examples/nowcastnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
wget https://paddle-org.bj.bcebos.com/paddlescience/datasets/nowcastnet/mrms.tar
# windows
# curl https://paddle-org.bj.bcebos.com/paddlescience/datasets/nowcastnet/mrms.tar --output mrms.tar
tar -xvf mrms.tar -C datasets/
mkdir ./datasets
tar -xvf mrms.tar -C ./datasets/
python nowcastnet.py mode=eval EVAL.pretrained_model_path=https://paddle-org.bj.bcebos.com/paddlescience/models/nowcastnet/nowcastnet_pretrained.pdparams
```

Expand Down
52 changes: 52 additions & 0 deletions examples/gpinn/conf/poisson_1d.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
hydra:
run:
# dynamic output directory according to running time and override name
dir: outputs_poisson_1d/${now:%Y-%m-%d}/${now:%H-%M-%S}/${hydra.job.override_dirname}
job:
name: ${mode} # name of logfile
chdir: false # keep current working direcotry unchaned
config:
override_dirname:
exclude_keys:
- TRAIN.checkpoint_path
- TRAIN.pretrained_model_path
- EVAL.pretrained_model_path
- mode
- output_dir
- log_freq
sweep:
# output directory for multirun
dir: ${hydra.run.dir}
subdir: ./

# general settings
mode: train # running mode: train/eval
seed: 2023
output_dir: ${hydra:run.dir}

# set working condition
NPOINT_PDE: 15
NPOINT_PDE_EVAL: 100

# model settings
MODEL:
input_keys: ["x"]
output_keys: ["u"]
num_layers: 3
hidden_size: 20
activation: "tanh"

# training settings
TRAIN:
epochs: 20000
iters_per_epoch: 1
eval_freq: 1000
eval_during_train: true
pretrained_model_path: null
checkpoint_path: null

# evaluation settings
EVAL:
batch_size:
l2rel_validator: ${NPOINT_PDE_EVAL}
pretrained_model_path: null
Loading

0 comments on commit 9239eb8

Please sign in to comment.