Documentation and comment improvements (#242)
This commit is contained in:
1 parent
15bef37b1d
commit
390f42f763
7 files changed
+100
-186
No files matched your search
+8
-4
@@ -9,12 +9,17 @@ defaults:
|
||||
- callbacks: default.yaml
|
||||
- logger: null # set logger here or use command line (e.g. `python run.py logger=wandb`)
|
||||
|
||||
# modes are special collections of config options for different purposes, e.g. debugging
|
||||
- mode: default.yaml
|
||||
|
||||
# experiment configs allow for version control of specific configurations
|
||||
# for example, use them to store best hyperparameters for each combination of model and datamodule
|
||||
- experiment: null
|
||||
|
||||
# config for hyperparameter optimization
|
||||
- hparams_search: null
|
||||
|
||||
# optional local config
|
||||
# optional local config for machine/user specific settings
|
||||
- optional local: default.yaml
|
||||
|
||||
# enable color logging
|
||||
@@ -22,7 +27,7 @@ defaults:
|
||||
- override hydra/job_logging: colorlog
|
||||
|
||||
# path to original working directory
|
||||
# hydra hijacks working directory by changing it to the current log directory,
|
||||
# hydra hijacks working directory by changing it to the new log directory
|
||||
# so it's useful to have this path as a special variable
|
||||
# https://hydra.cc/docs/next/tutorials/basic/running_your_app/working_directory
|
||||
work_dir: ${hydra:runtime.cwd}
|
||||
@@ -43,6 +48,5 @@ test_after_training: True
|
||||
# seed for random number generators in pytorch, numpy and python.random
|
||||
seed: null
|
||||
|
||||
# name of the run is accessed by loggers
|
||||
# should be used along with experiment mode
|
||||
# name of the run, should be used along with experiment mode
|
||||
name: null
|
||||
@@ -1,7 +1,7 @@
|
||||
# @package _global_
|
||||
|
||||
# to execute this experiment run:
|
||||
# python run.py experiment=example_simple.yaml
|
||||
# python run.py experiment=example
|
||||
|
||||
defaults:
|
||||
- override /mode: exp.yaml
|
||||
@@ -15,8 +15,8 @@ defaults:
|
||||
# this allows you to overwrite only specified parameters
|
||||
|
||||
# name of the run determines folder name in logs
|
||||
# it's also accessed by loggers
|
||||
name: "example_simple"
|
||||
# can also be accessed by loggers
|
||||
name: "example"
|
||||
|
||||
seed: 12345
|
||||
|
||||
@@ -34,3 +34,9 @@ model:
|
||||
datamodule:
|
||||
batch_size: 64
|
||||
train_val_test_split: [55_000, 5_000, 10_000]
|
||||
|
||||
logger:
|
||||
csv:
|
||||
name: csv/${name}
|
||||
wandb:
|
||||
tags: ["mnist", "simple_dense_net"]
|
||||
@@ -1,76 +0,0 @@
|
||||
# @package _global_
|
||||
|
||||
# to execute this experiment run:
|
||||
# python run.py experiment=example_full.yaml
|
||||
|
||||
defaults:
|
||||
- override /mode: exp.yaml
|
||||
- override /trainer: null
|
||||
- override /model: null
|
||||
- override /datamodule: null
|
||||
- override /callbacks: null
|
||||
- override /logger: null
|
||||
|
||||
# we override default configurations with nulls to prevent them from loading at all
|
||||
# instead we define all modules and their paths directly in this config,
|
||||
# so everything is stored in one place
|
||||
|
||||
# name of the run determines folder name in logs
|
||||
# it's also accessed by loggers
|
||||
name: "example_full"
|
||||
|
||||
seed: 12345
|
||||
|
||||
trainer:
|
||||
_target_: pytorch_lightning.Trainer
|
||||
gpus: 0
|
||||
min_epochs: 1
|
||||
max_epochs: 10
|
||||
gradient_clip_val: 0.5
|
||||
accumulate_grad_batches: 2
|
||||
weights_summary: "full"
|
||||
num_sanity_val_steps: 0
|
||||
|
||||
model:
|
||||
_target_: src.models.mnist_module.MNISTLitModule
|
||||
input_size: 784
|
||||
lin1_size: 256
|
||||
lin2_size: 256
|
||||
lin3_size: 128
|
||||
output_size: 10
|
||||
lr: 0.001
|
||||
weight_decay: 0.0005
|
||||
|
||||
datamodule:
|
||||
_target_: src.datamodules.mnist_datamodule.MNISTDataModule
|
||||
data_dir: ${data_dir}
|
||||
batch_size: 64
|
||||
train_val_test_split: [55_000, 5_000, 10_000]
|
||||
num_workers: 0
|
||||
pin_memory: False
|
||||
|
||||
callbacks:
|
||||
model_checkpoint:
|
||||
_target_: pytorch_lightning.callbacks.ModelCheckpoint
|
||||
monitor: "val/acc"
|
||||
mode: "max"
|
||||
save_top_k: 1
|
||||
save_last: True
|
||||
verbose: False
|
||||
dirpath: "checkpoints/"
|
||||
filename: "epoch_{epoch:03d}"
|
||||
auto_insert_metric_name: False
|
||||
early_stopping:
|
||||
_target_: pytorch_lightning.callbacks.EarlyStopping
|
||||
monitor: "val/acc"
|
||||
mode: "max"
|
||||
patience: 5
|
||||
min_delta: 0
|
||||
rich_progress_bar:
|
||||
_target_: pytorch_lightning.callbacks.RichProgressBar
|
||||
|
||||
logger:
|
||||
wandb:
|
||||
name: ${name}/${now:%Y-%m-%d}/${now:%H-%M-%S}
|
||||
tags: ["best_model", "mnist"]
|
||||
notes: "Description of this model."
|
||||
@@ -1,6 +1,9 @@
|
||||
# @package _global_
|
||||
|
||||
# run in debug mode with:
|
||||
# debug mode sets name of the logging folder to 'logs/debug/...'
|
||||
# enables trainer debug options
|
||||
# also sets level od command line logger to DEBUG
|
||||
# example usage:
|
||||
# `python run.py mode=debug`
|
||||
|
||||
defaults:
|
||||
@@ -16,7 +19,6 @@ hydra:
|
||||
# use this to set level of only chosen command line loggers to 'DEBUG'
|
||||
# verbose: [src.train, src.utils]
|
||||
|
||||
# sets output paths for all file logs to 'logs/debug/'
|
||||
run:
|
||||
dir: logs/debug/runs/${now:%Y-%m-%d}/${now:%H-%M-%S}
|
||||
sweep:
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
# @package _global_
|
||||
|
||||
# run in experiment mode with:
|
||||
# `python run.py mode=exp name=experiment_name`
|
||||
# experiment mode sets name of the logging folder to the experiment name
|
||||
# can also be used to name the run in the logger
|
||||
# example usage:
|
||||
# `python run.py mode=exp name=some_name`
|
||||
|
||||
experiment_mode: True
|
||||
|
||||
# allows for custom naming of the experiment
|
||||
name: ???
|
||||
|
||||
hydra:
|
||||
# sets output paths for all file logs to `logs/experiment/name'
|
||||
run:
|
||||
dir: logs/experiments/${name}/runs/${now:%Y-%m-%d}/${now:%H-%M-%S}
|
||||
sweep:
|
||||
|
||||
Reference in new issue
Block a user