Skip to content

A cookiecutter template that uses poetry for dependency management, created specifically for deep learning projects.

Notifications You must be signed in to change notification settings

icn2-ai/cookiecutter-poetry-deep-learning

Repository files navigation

Cookiecutter Poetry Deep Learning (ICN2)

Ask DeepWiki

This is a Cookiecutter template for deep-learning Python projects. It has all the necessary tools for development, testing, and deployment:



Generated projects architecture

The generated projects with this template will have the following architecture:

project_name
├── configs             # Configuration files for experiments
├── data                # Data for training and testing
├── docs                # Documentation files
├── notebooks           # Jupyter notebooks
├── tests               # Unit tests for the project
├── weights             # Trained models
├── project_slug (src)  # Code for the project 
    ├── base
    ├── data            # Data processing and loading
    ├── logger          # Logging
    ├── model           # Model definition, metrics, and losses
    ├── trainer         # Trainer class
    ├── utils           # Utility functions
    ├── visualization   # Visualization functions
    ├── test.py         
    ├── train.py        
├── Makefile
├── README.md

Files for version control, documentation, and CI/CD are not shown in the tree above.

Quickstart

On your local machine, install cookiecutter and directly pass the URL to this Github repository to the cookiecutter command:

pip install cookiecutter
cookiecutter https://github.com/icn2-ai/cookiecutter-poetry-deep-learning.git

If you have not installed poetry, follow the instructions here.

Create a repository on GitHub, and then run the following commands, replacing <project-name>, with the name that you gave the Github repository and <github_author_handle> with your Github username.

cd <project_name>
git init -b main
git add .
git commit -m "Init commit"
git remote add origin [email protected]:<github_author_handle>/<project_name>.git
git push -u origin main

Install the environment and the pre-commit hooks with:

make install

Then, before making the push to the remote repository, run the pre-commit hooks with:

make check

It might give an error the first time you run it, but mypy and ruff will correct the code style and type hints. You can run the pre-commit hooks again to check if everything is correct. After that, you can do the push.

You are now ready to start development on your project! The CI/CD pipeline will be triggered when you open a pull request, merge to main, or when you create a new release.

Acknowledgements

This project is based on Florian Maas' repository, cookiecutter-poetry, for the development of Python projects with Poetry, including CI/CD and code quality tools. The generated projects' architecture is inspired by Victor Huang's template fo deep-learning projects, pytorch-template.

About

A cookiecutter template that uses poetry for dependency management, created specifically for deep learning projects.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages