A template for projects built on tsl.
config/— Hydra configs:default.yamlplus thedataset/,model/andlogger/groups.experiments/run_experiment.py— training and evaluation script.lib/— project code (custom datasets inlib/datasets, models inlib/models).
python experiments/run_experiment.pyAny 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.003For 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.