diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-09-19 21:06:22 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-09-19 21:06:22 +0200 |
commit | b25c07af1986a73c2b129bfdcbefbc1dceef1885 (patch) | |
tree | 045b9789b7f594f5f16aa683a318c4ea3cefdd63 /training/utils.py | |
parent | 53dce464914b2ce3817a7cec9441f7cfa5048248 (diff) |
Add save of config to runs directory
Diffstat (limited to 'training/utils.py')
-rw-r--r-- | training/utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/training/utils.py b/training/utils.py index d23396e..6f57e4d 100644 --- a/training/utils.py +++ b/training/utils.py @@ -17,7 +17,14 @@ from tqdm import tqdm import wandb +def save_config(config: DictConfig) -> None: + """Save config to experiment directory.""" + with open("config.yaml", "w") as f: + OmegaConf.save(config, f=f) + + def print_config(config: DictConfig) -> None: + """Prints config.""" print(OmegaConf.to_yaml(config)) |