Skip to content
Public template

About

A template for projects built on tsl

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tsl_project_template

A template for projects built on tsl.

Structure

  • config/ — Hydra configs: default.yaml plus the dataset/, model/ and logger/ groups.
  • experiments/run_experiment.py — training and evaluation script.
  • lib/ — project code (custom datasets in lib/datasets, models in lib/models).

Running experiments

python experiments/run_experiment.py

Any config value can be overridden from the command line, e.g.:

python experiments/run_experiment.py model=rnn dataset=bay logger=tensorboard epochs=50 optimizer.hparams.lr=0.003

For a quick check that everything runs, use debug=True: it runs a single batch of training, validation and testing (Lightning's fast_dev_run) without saving checkpoints or logs.

To evaluate a trained model without training, pass its checkpoint. Quote the path, since Lightning checkpoint names contain =:

python experiments/run_experiment.py "load_model_path='/path/to/epoch=10-step=200.ckpt'"

Use --multirun for sweeps (python experiments/run_experiment.py --multirun seed=1,2,3). Runs are saved under logs/ (checkpoints, the resolved config and logger outputs).

To add a model or dataset, implement it in lib/, register it in get_model_class / get_dataset in experiments/run_experiment.py and add a matching file in config/model/ or config/dataset/. get_model_class returns the model together with the engine that trains it (Predictor or a subclass of it), so a model can bring its own training logic.

About

A template for projects built on tsl

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages