From b5130889b161e88e0109d4abdbe2f368e6670de1 Mon Sep 17 00:00:00 2001 From: Caleb Robinson Date: Mon, 4 Dec 2023 18:27:30 +0000 Subject: [PATCH] Experiments --- experiments/tsas/run_experiment.py | 12 +++++++-- .../tsas/run_experiment_sustainbench.py | 20 ++++++++++++++ experiments/tsas/sustainbench.yaml | 27 +++++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 experiments/tsas/run_experiment_sustainbench.py create mode 100644 experiments/tsas/sustainbench.yaml diff --git a/experiments/tsas/run_experiment.py b/experiments/tsas/run_experiment.py index c88f5cedd..8074bebb1 100644 --- a/experiments/tsas/run_experiment.py +++ b/experiments/tsas/run_experiment.py @@ -2,10 +2,18 @@ import subprocess if __name__ == "__main__": + # for i in range(10): + # subprocess.run([ + # "torchgeo", "fit", + # "--config", "experiments/tsas/cyclone.yaml", + # "--seed_everything", str(i), + # "--trainer.default_root_dir", f"logs/cyclone/resnet18_{i}", + # ]) + for i in range(10): subprocess.run([ "torchgeo", "fit", - "--config", "experiments/tsas/cyclone.yaml", + "--config", "experiments/tsas/cyclone_resnet50.yaml", "--seed_everything", str(i), - "--trainer.default_root_dir", f"logs/cyclone/resnet18_{i}", + "--trainer.default_root_dir", f"logs/cyclone/resnet50_{i}", ]) diff --git a/experiments/tsas/run_experiment_sustainbench.py b/experiments/tsas/run_experiment_sustainbench.py new file mode 100644 index 000000000..c7849b311 --- /dev/null +++ b/experiments/tsas/run_experiment_sustainbench.py @@ -0,0 +1,20 @@ +import subprocess + + +if __name__ == "__main__": + for i in range(10): + subprocess.run([ + "torchgeo", "fit", + "--config", "experiments/tsas/sustainbench.yaml", + "--seed_everything", str(i), + "--trainer.default_root_dir", f"logs/sustainbench/resnet18_{i}", + ]) + + for i in range(10): + subprocess.run([ + "torchgeo", "fit", + "--config", "experiments/tsas/sustainbench.yaml", + "--seed_everything", str(i), + "--trainer.default_root_dir", f"logs/sustainbench/resnet50_{i}", + "--model.model", "resnet50", + ]) diff --git a/experiments/tsas/sustainbench.yaml b/experiments/tsas/sustainbench.yaml new file mode 100644 index 000000000..586ff44e8 --- /dev/null +++ b/experiments/tsas/sustainbench.yaml @@ -0,0 +1,27 @@ +trainer: + max_epochs: 200 + accelerator: gpu + default_root_dir: logs/sustainbench/resnet18_0-1 + devices: + - 0 + callbacks: + - class_path: lightning.pytorch.callbacks.ModelCheckpoint + init_args: + monitor: val_loss + mode: min + save_top_k: 3 + save_last: true + filename: "{epoch}-{val_loss:.2f}" +model: + class_path: RegressionTask + init_args: + model: "resnet18" + in_channels: 9 + weights: true +data: + class_path: SustainBenchCropYieldDataModule + init_args: + batch_size: 64 + num_workers: 8 + dict_kwargs: + root: /home/calebrobinson/ssdshared/torchgeo-datasets/SustainBenchCropYield \ No newline at end of file