Date created: 30/07/2025
A example template of a pytorch project to reduce writing boilerplate code. Uses YAML config files
Check out directory-breakdown.md for in depth view of each file
- Add simple tests for each part
- Click "use this template" in top right, or create repo from template
- Setup a new virtual environment
- Create a dataset in "src/datasets/[dataset_name]_dataset.py". The class [DatasetName]Dataset must exist inside. Check dataloader logic in "src/datasets/setup.py"
- Create a model in "src/models/[model_name]_dataset.py". The class [ModelName]Model must exist inside. Check logic in "src/model/setup.py" works
- In "src/utils/utils.py", finish implementing setup_loss_function() and setup_optimiser()
- Add to config files as you go
- Debug
Python version 3.12 Pytorch not yet available on 3.13
- Create virtual environment named "venv"
$ python3 -m venv venv
-
If this has been created in this folder, add the name to the .gitignore file
-
Activate the virtual environment
$ source venv
- Install dependancies from requirements.txt
pip install -r requirements.txt
-
conda create --name bss312 python=3.12 -
conda activate bss312 -
conda install pip -
pip install -r requirements.txt
If changing environment dependamcies (e.g. with pip install numpy):
pip freeze > requirements.txt
git add requirements.txt