Release/1.0 (#156)
* update to Hydra 1.1 * add bash folder with scripts for conda setup and run scheduling * add saving seed in `log_hyperparameters()` method * redesign Dockerfile to make it weight less * add `test_after_training` parameter to config * add inheritance to trainer configs * remove forcing ddp-friendly configuration * refactor tests * remove conda_env_gpu.yaml * remove default langage version from pre-commit config * add mnist datamodule unit test * rename test folder from 'smoke' to 'shell' * remove wandb import from utils.py * change 'use_artifact' to 'log_artifact' in wandb callbacks * add rank zero decorator to wandb callbacks * add dumping rich tree config to file * get rid of `=` character in ckpt names * update requirements.txt * update LICENSE * update README.md
This commit is contained in:
1 parent
362a4beebb
commit
d45f604bc8
35 files changed
+398
-424
No files matched your search
@@ -1,16 +1,17 @@
|
||||
model_checkpoint:
|
||||
_target_: pytorch_lightning.callbacks.ModelCheckpoint
|
||||
monitor: "val/acc" # name of the logged metric which determines when model is improving
|
||||
mode: "max" # can be "max" or "min"
|
||||
save_top_k: 1 # save k best models (determined by above metric)
|
||||
save_last: True # additionaly always save model from last epoch
|
||||
mode: "max" # can be "max" or "min"
|
||||
verbose: False
|
||||
dirpath: "checkpoints/"
|
||||
filename: "{epoch:02d}"
|
||||
filename: "epoch_{epoch:03d}"
|
||||
auto_insert_metric_name: False
|
||||
|
||||
early_stopping:
|
||||
_target_: pytorch_lightning.callbacks.EarlyStopping
|
||||
monitor: "val/acc" # name of the logged metric which determines when model is improving
|
||||
patience: 100 # how many epochs of not improving until training stops
|
||||
mode: "max" # can be "max" or "min"
|
||||
patience: 100 # how many epochs of not improving until training stops
|
||||
min_delta: 0 # minimum change in the monitored metric needed to qualify as an improvement
|
||||
+5
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
# specify here default training configuration
|
||||
defaults:
|
||||
- trainer: minimal.yaml
|
||||
- trainer: default.yaml
|
||||
- model: mnist_model.yaml
|
||||
- datamodule: mnist_datamodule.yaml
|
||||
- callbacks: default.yaml # set this to null if you don't want to use callbacks
|
||||
@@ -37,3 +37,7 @@ print_config: True
|
||||
|
||||
# disable python warnings if they annoy you
|
||||
ignore_warnings: True
|
||||
|
||||
# check performance on test set, using the best model achieved during training
|
||||
# lightning chooses best model based on metric specified in checkpoint callback
|
||||
test_after_training: True
|
||||
@@ -30,7 +30,6 @@ model:
|
||||
_target_: src.models.mnist_model.MNISTLitModel
|
||||
lr: 0.001
|
||||
weight_decay: 0.00005
|
||||
architecture: SimpleDenseNet
|
||||
input_size: 784
|
||||
lin1_size: 256
|
||||
lin2_size: 256
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# python run.py experiment=example_simple.yaml
|
||||
|
||||
defaults:
|
||||
- override /trainer: minimal.yaml # choose trainer from 'configs/trainer/'
|
||||
- override /trainer: default.yaml # choose trainer from 'configs/trainer/'
|
||||
- override /model: mnist_model.yaml
|
||||
- override /datamodule: mnist_datamodule.yaml
|
||||
- override /callbacks: default.yaml
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
neptune:
|
||||
_target_: pytorch_lightning.loggers.neptune.NeptuneLogger
|
||||
api_key: ${oc.env:NEPTUNE_API_TOKEN} # api key is laoded from environment variable
|
||||
api_key: ${oc.env:NEPTUNE_API_TOKEN} # api key is loaded from environment variable
|
||||
project_name: your_name/template-tests
|
||||
close_after_fit: True
|
||||
offline_mode: False
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
_target_: pytorch_lightning.Trainer
|
||||
|
||||
# default values for all trainer parameters
|
||||
checkpoint_callback: True
|
||||
default_root_dir: null
|
||||
gradient_clip_val: 0.0
|
||||
process_position: 0
|
||||
num_nodes: 1
|
||||
num_processes: 1
|
||||
gpus: null
|
||||
auto_select_gpus: False
|
||||
tpu_cores: null
|
||||
log_gpu_memory: null
|
||||
progress_bar_refresh_rate: 1
|
||||
overfit_batches: 0.0
|
||||
track_grad_norm: -1
|
||||
check_val_every_n_epoch: 1
|
||||
fast_dev_run: False
|
||||
accumulate_grad_batches: 1
|
||||
max_epochs: 1
|
||||
min_epochs: 1
|
||||
max_steps: null
|
||||
min_steps: null
|
||||
limit_train_batches: 1.0
|
||||
limit_val_batches: 1.0
|
||||
limit_test_batches: 1.0
|
||||
val_check_interval: 1.0
|
||||
flush_logs_every_n_steps: 100
|
||||
log_every_n_steps: 50
|
||||
accelerator: null
|
||||
sync_batchnorm: False
|
||||
precision: 32
|
||||
weights_summary: "top"
|
||||
weights_save_path: null
|
||||
num_sanity_val_steps: 2
|
||||
truncated_bptt_steps: null
|
||||
resume_from_checkpoint: null
|
||||
profiler: null
|
||||
benchmark: False
|
||||
deterministic: False
|
||||
reload_dataloaders_every_epoch: False
|
||||
auto_lr_find: False
|
||||
replace_sampler_ddp: True
|
||||
terminate_on_nan: False
|
||||
auto_scale_batch_size: False
|
||||
prepare_data_per_node: True
|
||||
plugins: null
|
||||
amp_backend: "native"
|
||||
amp_level: "O2"
|
||||
move_metrics_to_cpu: False
|
||||
@@ -1,4 +1,5 @@
|
||||
_target_: pytorch_lightning.Trainer
|
||||
defaults:
|
||||
- default.yaml
|
||||
|
||||
gpus: 4
|
||||
accelerator: ddp
|
||||
@@ -1,4 +1,5 @@
|
||||
_target_: pytorch_lightning.Trainer
|
||||
defaults:
|
||||
- default.yaml
|
||||
|
||||
gpus: 0
|
||||
|
||||
@@ -11,8 +12,8 @@ weights_summary: null
|
||||
profiler: null
|
||||
|
||||
# debugs
|
||||
num_sanity_val_steps: 2
|
||||
fast_dev_run: False
|
||||
num_sanity_val_steps: 2
|
||||
overfit_batches: 0
|
||||
limit_train_batches: 1.0
|
||||
limit_val_batches: 1.0
|
||||
|
||||
@@ -1,50 +1,11 @@
|
||||
_target_: pytorch_lightning.Trainer
|
||||
|
||||
# default values for all trainer parameters
|
||||
checkpoint_callback: True
|
||||
default_root_dir: null
|
||||
gradient_clip_val: 0.0
|
||||
process_position: 0
|
||||
num_nodes: 1
|
||||
num_processes: 1
|
||||
gpus: null
|
||||
auto_select_gpus: False
|
||||
tpu_cores: null
|
||||
log_gpu_memory: null
|
||||
progress_bar_refresh_rate: 1
|
||||
overfit_batches: 0.0
|
||||
track_grad_norm: -1
|
||||
check_val_every_n_epoch: 1
|
||||
fast_dev_run: False
|
||||
accumulate_grad_batches: 1
|
||||
max_epochs: 1
|
||||
# set `1` to train on GPU, `0` to train on CPU only
|
||||
gpus: 0
|
||||
|
||||
min_epochs: 1
|
||||
max_steps: null
|
||||
min_steps: null
|
||||
limit_train_batches: 1.0
|
||||
limit_val_batches: 1.0
|
||||
limit_test_batches: 1.0
|
||||
val_check_interval: 1.0
|
||||
flush_logs_every_n_steps: 100
|
||||
log_every_n_steps: 50
|
||||
accelerator: null
|
||||
sync_batchnorm: False
|
||||
precision: 32
|
||||
weights_summary: "top"
|
||||
weights_save_path: null
|
||||
num_sanity_val_steps: 2
|
||||
truncated_bptt_steps: null
|
||||
max_epochs: 10
|
||||
|
||||
weights_summary: null
|
||||
progress_bar_refresh_rate: 5
|
||||
resume_from_checkpoint: null
|
||||
profiler: null
|
||||
benchmark: False
|
||||
deterministic: False
|
||||
reload_dataloaders_every_epoch: False
|
||||
auto_lr_find: False
|
||||
replace_sampler_ddp: True
|
||||
terminate_on_nan: False
|
||||
auto_scale_batch_size: False
|
||||
prepare_data_per_node: True
|
||||
plugins: null
|
||||
amp_backend: "native"
|
||||
amp_level: "O2"
|
||||
move_metrics_to_cpu: False
|
||||
@@ -1,11 +0,0 @@
|
||||
_target_: pytorch_lightning.Trainer
|
||||
|
||||
# set `1` to train on GPU, `0` to train on CPU only
|
||||
gpus: 0
|
||||
|
||||
min_epochs: 1
|
||||
max_epochs: 10
|
||||
|
||||
weights_summary: null
|
||||
progress_bar_refresh_rate: 10
|
||||
# resume_from_checkpoint: null
|
||||
Reference in new issue
Block a user