update readme
This commit is contained in:
1 parent
9a5a4eb192
commit
f90ceab605
5 files changed
+200
-135
No files matched your search
@@ -4,7 +4,7 @@ model_checkpoint:
|
||||
class: pytorch_lightning.callbacks.ModelCheckpoint
|
||||
args:
|
||||
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: 2 # 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"
|
||||
filepath: "checkpoints/{epoch}"
|
||||
|
||||
@@ -6,9 +6,12 @@ defaults:
|
||||
- datamodule: mnist_datamodule.yaml
|
||||
- optimizer: adam.yaml
|
||||
- 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
|
||||
- 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`)
|
||||
|
||||
- override hydra/job_logging: colorlog
|
||||
- override hydra/hydra_logging: colorlog
|
||||
|
||||
# path to working directory (the directory that `train.py` was executed from in command line)
|
||||
work_dir: ${hydra:runtime.cwd}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ args:
|
||||
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
|
||||
# fast_dev_run: True # bugged :(
|
||||
limit_train_batches: 1.0
|
||||
limit_val_batches: 1.0
|
||||
limit_test_batches: 1.0
|
||||
|
||||
@@ -10,7 +10,7 @@ import os
|
||||
|
||||
class SaveCodeToWandb(Callback):
|
||||
"""
|
||||
Upload all *.py files to wandb at the beginning of the run.
|
||||
Upload all *.py files to wandb as an artifact at the beginning of the run.
|
||||
"""
|
||||
def __init__(self, code_dir: str):
|
||||
self.code_dir = code_dir
|
||||
@@ -24,6 +24,9 @@ class SaveCodeToWandb(Callback):
|
||||
|
||||
|
||||
class UploadAllCheckpointsToWandb(Callback):
|
||||
"""
|
||||
Upload experiment checkpoints to wandb as an artifact at the end of training.
|
||||
"""
|
||||
def __init__(self, ckpt_dir: str = "checkpoints/", upload_best_only: bool = False):
|
||||
self.ckpt_dir = ckpt_dir
|
||||
self.upload_best_only = upload_best_only
|
||||
@@ -43,7 +46,7 @@ class UploadAllCheckpointsToWandb(Callback):
|
||||
|
||||
class SaveMetricsHeatmapToWandb(Callback):
|
||||
"""
|
||||
Generate f1, precision and recall heatmap from validation epoch outputs.
|
||||
Generate f1, precision and recall heatmap from validation step outputs.
|
||||
Expects validation step to return predictions and targets.
|
||||
Works only for single label classification!
|
||||
"""
|
||||
@@ -133,6 +136,14 @@ class SaveConfusionMatrixToWandb(Callback):
|
||||
|
||||
|
||||
class SaveBestMetricScoresToWandb(Callback):
|
||||
"""
|
||||
Store in wandb:
|
||||
- max train acc
|
||||
- min train loss
|
||||
- max val acc
|
||||
- min val loss
|
||||
Useful for comparing runs in table views, as wandb doesn't currently supports column aggregation.
|
||||
"""
|
||||
def __init__(self):
|
||||
self.train_loss_best = None
|
||||
self.train_acc_best = None
|
||||
|
||||
Reference in new issue
Block a user