* refactor folder names

* define python logger correctly

* refactor rich printing method

* specify model parameters explicitly

* specify datamodule params explicitly

* refactor

* update readme
This commit is contained in:
Łukasz Zalewski authored and GitHub committed 2021-03-25 01:31:52 +01:00
1 parent fca999f527
commit 381b5844ed
18 files changed
+133 -168

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
model_checkpoint:
_target_: pytorch_lightning.callbacks.ModelCheckpoint
monitor: "val/acc" # name of the logged metric which determines when model is improving
save_top_k: 2 # save k best models (determined by above metric)
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
+14 -14
View File
@@ -2,26 +2,26 @@ defaults:
- default_callbacks.yaml
upload_code_to_wandb_as_artifact:
_target_: src.callbacks.wandb_callbacks.UploadCodeToWandbAsArtifact
code_dir: ${work_dir}
upload_ckpts_to_wandb_as_artifact:
_target_: src.callbacks.wandb_callbacks.UploadCheckpointsToWandbAsArtifact
ckpt_dir: "checkpoints/"
upload_best_only: True
watch_model_with_wandb:
_target_: src.callbacks.wandb_callbacks.WatchModelWithWandb
_target_: src.pl_callbacks.wandb_callbacks.WatchModelWithWandb
log: "all"
log_freq: 100
upload_code_to_wandb_as_artifact:
_target_: src.pl_callbacks.wandb_callbacks.UploadCodeToWandbAsArtifact
code_dir: ${work_dir}
upload_ckpts_to_wandb_as_artifact:
_target_: src.pl_callbacks.wandb_callbacks.UploadCheckpointsToWandbAsArtifact
ckpt_dir: "checkpoints/"
upload_best_only: True
save_f1_precision_recall_heatmap_to_wandb:
_target_: src.callbacks.wandb_callbacks.LogF1PrecRecHeatmapToWandb
_target_: src.pl_callbacks.wandb_callbacks.LogF1PrecRecHeatmapToWandb
save_confusion_matrix_to_wandb:
_target_: src.callbacks.wandb_callbacks.LogConfusionMatrixToWandb
_target_: src.pl_callbacks.wandb_callbacks.LogConfusionMatrixToWandb
+3 -9
View File
@@ -14,36 +14,30 @@ defaults:
# - override hydra/job_logging: colorlog
# path to original working directory (that `run.py` was executed from in command line)
# path to original working directory
# hydra hijacks working directory by changing it to the current log directory,
# so it's useful to have path to original work dir as a special variable
# read more here: https://hydra.cc/docs/next/tutorials/basic/running_your_app/working_directory
# so it's useful to have this path as a special variable
# learn more here: https://hydra.cc/docs/next/tutorials/basic/running_your_app/working_directory
work_dir: ${hydra:runtime.cwd}
# path to folder with data
data_dir: ${work_dir}/data/
# use `python run.py debug=true` for easy debugging!
# this will run 1 train, val and test loop with only 1 batch
# equivalent to running `python run.py trainer.fast_dev_run=true`
# (this is placed here just for easier access from command line)
debug: False
# pretty print config at the start of the run using Rich library
print_config: True
# disable python warnings if they annoy you
disable_warnings: True
# disable lightning logs if they annoy you
disable_lightning_logs: False
hydra:
# output paths for hydra logs
run:
+1 -1
View File
@@ -1,4 +1,4 @@
_target_: src.datamodules.mnist_datamodule.MNISTDataModule
_target_: src.pl_datamodules.mnist_datamodule.MNISTDataModule
data_dir: ${data_dir} # data_dir is specified in config.yaml
batch_size: 64
+3 -6
View File
@@ -28,18 +28,15 @@ trainer:
# resume_from_checkpoint: ${work_dir}/last.ckpt
model:
_target_: src.models.mnist_model.LitModelMNIST
_target_: src.pl_models.mnist_model.MNISTLitModel
optimizer: adam
lr: 0.001
weight_decay: 0.00005
architecture: SimpleDenseNet
input_size: 784
lin1_size: 256
dropout1: 0.30
lin2_size: 256
dropout2: 0.25
lin3_size: 128
dropout3: 0.20
output_size: 10
optimizer:
@@ -48,7 +45,7 @@ optimizer:
weight_decay: 0
datamodule:
_target_: src.datamodules.mnist_datamodule.MNISTDataModule
_target_: src.pl_datamodules.mnist_datamodule.MNISTDataModule
data_dir: ${data_dir}
batch_size: 64
train_val_test_split: [55_000, 5_000, 10_000]
@@ -67,7 +64,7 @@ callbacks:
early_stopping:
_target_: pytorch_lightning.callbacks.EarlyStopping
monitor: "val/acc"
patience: 100
patience: 10
mode: "max"
logger:
+1 -1
View File
@@ -6,7 +6,7 @@
defaults:
- override /trainer: default_trainer.yaml # choose trainer from 'configs/trainer/' folder or set to null
- override /model: mnist_model.yaml # choose model from 'configs/model/' folder or set to null
- override /optimizer: adam.yaml # choose model from 'configs/model/' folder or set to null
- override /optimizer: adam.yaml # choose model from 'configs/model/' folder or set to null
- override /datamodule: mnist_datamodule.yaml # choose datamodule from 'configs/datamodule/' folder or set to null
- override /callbacks: default_callbacks.yaml # choose callback set from 'configs/callbacks/' folder or set to null
- override /logger: null # choose logger from 'configs/logger/' folder or set to null
+2 -5
View File
@@ -1,10 +1,7 @@
_target_: src.models.mnist_model.LitModelMNIST
_target_: src.pl_models.mnist_model.MNISTLitModel
input_size: 784
lin1_size: 256
dropout1: 0.30
lin2_size: 256
dropout2: 0.25
lin3_size: 128
dropout3: 0.20
lin3_size: 256
output_size: 10