making progress with hydra

This commit is contained in:
hobogalaxy committed 2021-01-07 22:40:21 +01:00
1 parent 610117f161
commit d24568e686
21 files changed
+142 -104

No files matched your search

+10 -9
View File
@@ -5,19 +5,20 @@ defaults:
- model: simple_mnist_classifier.yaml
- datamodule: mnist_datamodule.yaml
- optimizer: adam.yaml
- callbacks: default_callbacks.yaml
- loggers: null
- seeds: default_seeds.yaml # set this to null if you don't want to use seeds
- callbacks: default_callbacks.yaml # set this to null if you don't want to use callbacks
- logger: null # set logger here or use command line (e.g. `python train.py logger=wandb`)
seeds:
pytorch_seed: 12345
# path to working directory (the directory that `train.py` was executed from in command line)
work_dir: ${hydra:runtime.cwd}
paths:
data_dir: "data" # path to data folder (either absolute or relative to placement of 'train.py' file)
logs_dir: "logs" # path to logs folder (either absolute or relative to placement of 'train.py' file)
# path to folder with data
data_dir: ${work_dir}/data/
# hydra output paths
hydra:
run:
dir: ${paths.logs_dir}/hydra_logs/runs/${now:%Y-%m-%d}/${now:%H-%M-%S}
dir: logs/runs/${now:%Y-%m-%d}/${now:%H-%M-%S}
sweep:
dir: ${paths.logs_dir}/hydra_logs/sweeps/${now:%Y-%m-%d_%H-%M-%S}
dir: logs/multiruns/${now:%Y-%m-%d_%H-%M-%S}
subdir: ${hydra.job.num}
@@ -37,7 +37,7 @@ model:
datamodule:
args: # you can add here any params you want and then access them in lightning datamodule
batch_size: 64
train_val_test_split: (55_000, 5_000, 10_000)
train_val_test_split: [55_000, 5_000, 10_000]
num_workers: 1 # num of processes used for loading data in parallel
pin_memory: False # dataloaders will copy tensors into CUDA pinned memory before returning them
@@ -48,7 +48,7 @@ optimizer:
loggers:
wandb:
args: # you can add here additional loggers arguments specific for this experiment
args: # you can add here additional logger arguments specific for this experiment
tags: ["uwu", "best_model"]
notes: ""
group: ""
@@ -28,7 +28,7 @@ model:
datamodule:
args:
batch_size: 32
train_val_test_split: (55_000, 5_000, 10_000)
train_val_test_split: [55_000, 5_000, 10_000]
optimizer:
args:
+8
View File
@@ -0,0 +1,8 @@
# @package _group_
# Train with all logger at once
defaults:
- comet.yaml
- csv_logger.yaml
- tensorboard.yaml
- wandb.yaml
@@ -2,7 +2,7 @@
# Comet logger config
comet:
class: pytorch_lightning.loggers.CometLogger
class: pytorch_lightning.logger.CometLogger
args:
api_key: ???
project_name: "project_template_test"
@@ -2,5 +2,5 @@
# Csv logger config
csv_logger:
class: pytorch_lightning.loggers.CSVLogger
class: pytorch_lightning.logger.CSVLogger
args: {}
@@ -2,5 +2,5 @@
# Tensorboard logger config
tensorboard:
class: pytorch_lightning.loggers.TensorboardLogger
class: pytorch_lightning.logger.TensorboardLogger
args: {}
@@ -2,13 +2,13 @@
# Weights&Biases logger config
wandb:
class: pytorch_lightning.loggers.WandbLogger
class: pytorch_lightning.logger.WandbLogger
args:
project: "project_template_test"
entity: "" # change to your username or name of your team on wandb
# entity: "your_team_name" # set to name of your team on wandb
offline: False # set True to store all logs only locally
job_type: "train"
save_dir: ${paths.logs_dir}
save_dir: "./"
# some extra things which will be logged by the environment
extra_logs:
@@ -17,10 +17,10 @@ wandb:
log_train_val_test_sizes: True # log sizes of train dataset, val dataset and test dataset
log_model_args: True # log
log_datamodule_args: True # log
log_optimizer_args: True # log
log_trainer_args: False # log
log_model_args: True
log_datamodule_args: True
log_optimizer_args: True
log_trainer_args: False
log_model_class_name: True
log_datamodule_class_name: True
-8
View File
@@ -1,8 +0,0 @@
# @package _group_
# Train with all loggers at once
defaults:
- comet
- csv_logger
- tensorboard
- wandb
+3
View File
@@ -0,0 +1,3 @@
# @package _group_
pytorch_seed: 12345
+3 -3
View File
@@ -2,7 +2,7 @@
# trainer args for debugging model
args:
gpus: -1 # set -1 to train on all GPUs abailable, set 0 to train on CPU only
gpus: -1 # set -1 to train on all GPUs abailable, set 0 to train on CPU only
auto_select_gpus: True
fast_dev_run: True
@@ -13,5 +13,5 @@ args:
profiler: "simple" # use profiler to print execution time profiling after training ends
progress_bar_refresh_rate: 10
weights_summary: "top"
default_root_dir: ${paths.logs_dir}/lightning_logs
weights_summary: "full"
default_root_dir: "lightning_logs/"
+4 -5
View File
@@ -1,12 +1,11 @@
# @package _group_
# args passed to Lightning Trainer on every experiment
# they will be combined with trainer args specified in experiment config
# (if the argument repeats in experiment config, then it will override the one set here)
# default args passed to Lightning Trainer on every experiment
# they can be combined or overwritten with args set in experiment config
args:
gpus: -1 # set -1 to train on all GPUs available, set 0 to train on CPU only
auto_select_gpus: True
num_sanity_val_steps: 3
weights_summary: "top"
progress_bar_refresh_rate: 10
default_root_dir: ${paths.logs_dir}/lightning_logs
weights_summary: null # null in yaml represents python None value
default_root_dir: "lightning_logs/"