Project template to be used together with pytorch-lantern.
See pytorch-lantern for instructions.
What each directory in the newly-initialized project contains:
Problem formulation in a natural (human-readable) form. Datastreams for training and evaluation.
- Splits data in train / early_stopping / compare
- Augments data
- Create informative batches (oversample, stratify, etc)
- Works with the natural format of the examples
- Contains train/compare and train/early stopping splits as
.json
files.
Helper functions for running inference and downloading model weights if they are not packaged.
Contains the model architecture as well as functions to convert the data from human-readable to model-readable.
- Preprocessing natural data into model-interpretable data
- Model
- Predictions (model output representation with helper functions)
- Loss
- Prediction visualization
Operations are scripts that are run via the guild CLI that saves artefacts from the run such as model checkpoints.
These often include:
guild run train
guild run retrain model=xyz
guild run evaluate model=xyz
Install dev dependencies like cookiecutter.
poetry install
Setup test environment
./test/create.sh
Download and prepare dataset
./test/prepare.sh
Run tests in any order
./test/run.sh
./test/test.sh
It can be useful to chain create and run when developing
./test/create.sh && ./test/run.sh
or create and prepare:
./test/create.sh && ./test/prepare.sh
You cannot activate two environments at the same time. You should not have the outer template environment activated (i.e. poetry shell) when running the development scripts above.