start redesigning project structure for version 4.0

This commit is contained in:
hobogalaxy committed 2020-12-29 01:48:44 +01:00
1 parent 42652e3752
commit fa8b9ecc16
18 files changed
+140 -130

No files matched your search

+7 -7
View File
@@ -11,12 +11,12 @@ Click on <b>"Use this template"</b> button above to initialize new repository.<b
- ~~Automatically stores all relevant code, configs and model checkpoints in Weights&Biases cloud~~ (TODO)
- Hyperparameter search with Weights&Biases sweeps ([execute_sweep.py](project/template_utils/execute_sweep.py))
- Automates the whole training process, you only need to create model and datamodule and specify them in [run_configs.yaml](project/run_configs.yaml)
- Scheduling execution of many runs/experiments ([execute_all_runs.py](project/template_utils/execute_all_runs.py))
- Scheduling execution of many runs/experiments ([execute_all_runs.py](project/template_utils/execute_all_experiments.py))
- Built in requirements ([requirements.txt](requirements.txt))
- Built in conda environment initialization ([conda_env.yaml](conda_env.yaml))
- Built in package setup ([setup.py](setup.py))
- Example with MNIST digits classification
- Useful example callbacks ([callbacks.py](project/template_utils/callbacks.py))
- Useful example callbacks ([callbacks.py](project/pytorch_modules/lightning_callbacks/custom_callbacks.py))
<br>
@@ -83,7 +83,7 @@ loggers:
default_callbacks:
ModelCheckpoint:
monitor: "val_acc" <- name of the logged metric which determines when model is improving
save_top_k: 1 <- save k best models (determined by above metric)
save_top_k: 1 <- save k best lightning_models (determined by above metric)
save_last: True <- additionaly always save model from last epoch
mode: "max" <- can be "max" or "min"
EarlyStopping:
@@ -113,7 +113,7 @@ SIMPLE_CONFIG_EXAMPLE_MNIST:
max_epochs: 10
model:
load_from:
model_path: "models/simple_mnist_classifier/lightning_module.py"
model_path: "lightning_models/simple_mnist_classifier/simple_mnist_classifier.py"
model_class: "LitModel"
hparams:
lr: 0.001
@@ -125,7 +125,7 @@ SIMPLE_CONFIG_EXAMPLE_MNIST:
lin3_size: 128
datamodule:
load_from:
datamodule_path: "datamodules/mnist_datamodule/datamodule.py"
datamodule_path: "lightning_datamodules/mnist_datamodule/mnist_datamodule.py"
datamodule_class: "MNISTDataModule"
hparams:
batch_size: 64
@@ -138,9 +138,9 @@ Each run configuration needs to contain sections `trainer`, `model` and `datamod
Every other section is optional! (see [run_configs.yaml](project/run_configs.yaml) for more advanced config example with optional sections)<br>
Every parameter specified in model hparams section will be passed to your model class and can be retrieved through `hparams` dictionary (see example with [simple_mnist_classifier](project/models/simple_mnist_classifier/lightning_module.py)).<br>
Every parameter specified in model hparams section will be passed to your model class and can be retrieved through `hparams` dictionary (see example with [simple_mnist_classifier](project/pytorch_modules/lightning_models/simple_mnist_classifier.py)).<br>
Every parameter specified in datamodule hparams section will be passed to your datamodule class and can be retrieved through `hparams` dictionary (see example with [mnist_datamodule](project/datamodules/mnist_datamodule/datamodule.py)).<br>
Every parameter specified in datamodule hparams section will be passed to your datamodule class and can be retrieved through `hparams` dictionary (see example with [mnist_datamodule](project/pytorch_modules/lightning_datamodules/mnist_datamodule.py)).<br>
<br>