About • Examples • Installation • How To Use • Useful Links • Credits • License
This repository contains a template for PyTorch-based Deep Learning projects.
The template utilizes different python-dev techniques to improve code readability. Configuration methods enhance reproducibility and experiments control.
Repository is released as a part of HSE DLA course, however, can easily be adopted for any DL-task.
Important
The main branch leaves some of the code parts empty or fills them with dummy examples, showing just the base structure. The final users can add code required for their own tasks.
You can find examples of this template completed for different tasks in other branches:
-
Image classification: simple classification problem on MNIST and CIFAR-10 datasets.
-
ASR: template for the automatic speech recognition (ASR) task. Some of the parts (for example,
collate_fn
) are missing for studying purposes of HSE DLA course.
Installation may depend on your task. The general steps are the following:
-
(Optional) Create and activate new environment using
conda
orvenv
(+pyenv
).a.
conda
version:# create env conda create -n project_env python=PYTHON_VERSION # activate env conda activate project_env
b.
venv
(+pyenv
) version:# create env ~/.pyenv/versions/PYTHON_VERSION/bin/python3 -m venv project_env # alternatively, using default python version python3 -m venv project_env # activate env source project_env
-
Install all required packages
pip install -r requirements.txt
-
Install
pre-commit
:pre-commit install
To train a model, run the following command:
python3 train.py -cn=CONFIG_NAME HYDRA_CONFIG_ARGUMENTS
Where CONFIG_NAME
is a config from src/configs
and HYDRA_CONFIG_ARGUMENTS
are optional arguments.
You may find the following liks useful:
-
Python Dev Tips: information about pre-commits, Hydra, and other stuff for better python code development.
-
Awesome README: a list of awesome README files for inspiration. Check the basics here.
-
Report branch: Guidelines for writing a scientific report/paper (with an emphasis on DL projects).
This repository is based on a heavily modified fork of pytorch-template and asr_project_template repositories.