Skip to content

Commit

Permalink
add exclude_keys for amgnet yaml and fix document typo (PaddlePaddle#677
Browse files Browse the repository at this point in the history
)
  • Loading branch information
HydrogenSulfate authored Dec 4, 2023
1 parent 842ac9f commit 6b3cbf3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/zh/examples/amgnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# curl https://paddle-org.bj.bcebos.com/paddlescience/datasets/AMGNet/data.zip --output data.zip
# unzip it
unzip data.zip
python amgnet_airfoil.py mode=eval EVAL.pretained_model_path=https://paddle-org.bj.bcebos.com/paddlescience/models/amgnet/amgnet_airfoil_pretrained.pdparams
python amgnet_airfoil.py mode=eval EVAL.pretrained_model_path=https://paddle-org.bj.bcebos.com/paddlescience/models/amgnet/amgnet_airfoil_pretrained.pdparams
```
=== "amgnet_cylinder"

Expand Down
5 changes: 5 additions & 0 deletions examples/amgnet/amgnet_airfoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ def train(cfg: DictConfig):


def evaluate(cfg: DictConfig):
# set random seed for reproducibility
ppsci.utils.misc.set_random_seed(cfg.seed)
# initialize logger
logger.init_logger("ppsci", osp.join(cfg.output_dir, "eval.log"), "info")

# set airfoil model
model = ppsci.arch.AMGNet(**cfg.MODEL)

Expand Down
5 changes: 5 additions & 0 deletions examples/amgnet/amgnet_cylinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ def train(cfg: DictConfig):


def evaluate(cfg: DictConfig):
# set random seed for reproducibility
ppsci.utils.misc.set_random_seed(cfg.seed)
# initialize logger
logger.init_logger("ppsci", osp.join(cfg.output_dir, "eval.log"), "info")

# set airfoil model
model = ppsci.arch.AMGNet(**cfg.MODEL)

Expand Down
9 changes: 9 additions & 0 deletions examples/amgnet/conf/amgnet_airfoil.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ hydra:
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}
Expand Down
9 changes: 9 additions & 0 deletions examples/amgnet/conf/amgnet_cylinder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ hydra:
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}
Expand Down

0 comments on commit 6b3cbf3

Please sign in to comment.