DL-template

Description

Good practice deep learning project starter, strongly inspired from Template. It uses the following libraries:

  • Pytorch (deep learning framework)
  • Pytorch Lightning (Pytorch wrapper for flexible and scalable trainings)
  • Hydra (configuration tool)
  • Weight and biases (experiment logging framework)
  • Poetry (package manager)
  • Sphinx (documentation)

Project name update

Choose carefully your project name, then rename every project_src variable in every file, but also rename every file or folder containing this string.

Other tools

  • .env.example can be used to store private variables
  • .gitlab-ci.yml deploy the documentation on gitlab pages
  • use the folder ./tests to run tests with pytest

Quickstart

Requirements

  • python=^3.7,<3.11
  • poetry=^1.1.6. You can install it as written in their doc.

Environment and dependencies

poetry install

Training a model

# default
poetry run python run.py

# config update via command line
poetry run python run.py trainer.gpus=1

Documentation

Documentation is generated by sphinx and uses the theme furo.

cd docs
make html

To execute again autodoc: sphinx-apidoc -o source ../project_src

Open documentation with start build\html\index.html (windows), else run open build/html/index.html