summaryrefslogtreecommitdiff
path: root/src/training/prepare_experiments.py
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2021-03-20 18:09:06 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2021-03-20 18:09:06 +0100
commit7e8e54e84c63171e748bbf09516fd517e6821ace (patch)
tree996093f75a5d488dddf7ea1f159ed343a561ef89 /src/training/prepare_experiments.py
parentb0719d84138b6bbe5f04a4982dfca673aea1a368 (diff)
Inital commit for refactoring to lightning
Diffstat (limited to 'src/training/prepare_experiments.py')
-rw-r--r--src/training/prepare_experiments.py34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/training/prepare_experiments.py b/src/training/prepare_experiments.py
deleted file mode 100644
index 21997af..0000000
--- a/src/training/prepare_experiments.py
+++ /dev/null
@@ -1,34 +0,0 @@
-"""Run a experiment from a config file."""
-import json
-
-import click
-import yaml
-
-
-def run_experiments(experiments_filename: str) -> None:
- """Run experiment from file."""
- with open(experiments_filename, "r") as f:
- experiments_config = yaml.safe_load(f)
-
- num_experiments = len(experiments_config["experiments"])
- for index in range(num_experiments):
- experiment_config = experiments_config["experiments"][index]
- experiment_config["experiment_group"] = experiments_config["experiment_group"]
- cmd = f"poetry run run-experiment --gpu=-1 --save '{json.dumps(experiment_config)}'"
- print(cmd)
-
-
-@click.command()
-@click.option(
- "--experiments_filename",
- required=True,
- type=str,
- help="Filename of Yaml file of experiments to run.",
-)
-def run_cli(experiments_filename: str) -> None:
- """Parse command-line arguments and run experiments from provided file."""
- run_experiments(experiments_filename)
-
-
-if __name__ == "__main__":
- run_cli()