y1zhou / lightning-hydra-cookiecutter

PyTorch Lightning + Hydra. A very user-friendly template for ML experimentation. ⚑πŸ”₯⚑

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lightning-Hydra-Cookiecutter

python pytorch lightning hydra black

A clean template to kickstart your deep learning project πŸš€βš‘πŸ”₯

Suggestions are always welcome!


πŸš€  Quickstart

If you don't already have cookiecutter installed, use either of the following tools to add it to your PATH:

python3 -m pip install --user cookiecutter
conda install -c conda-forge cookiecutter
pipx install cookiecutter
brew install cookiecutter # macOS only

Now you can generate a new project from this template with a one-liner. Note that you will be asked for a few things like the project name, open source license, etc. to bootstrap the project.

cookiecutter https://github.com/y1zhou/lightning-hydra-cookiecutter

Project Structure

The directory structure of new project looks like this:

β”œβ”€β”€ docs               <- A default MkDocs project; see www.mkdocs.org for details
β”‚
β”œβ”€β”€ data               <- Project data
β”‚   β”œβ”€β”€ external           <- Data from third party sources.
β”‚   β”œβ”€β”€ raw                <- The original, immutable data dump.
β”‚   β”œβ”€β”€ interim            <- Intermediate data that has been transformed.
β”‚   └── processed          <- The final, canonical data sets for modeling.
β”‚
β”œβ”€β”€ references         <- Data dictionaries, manuals, and all other explanatory materials.
β”‚
β”œβ”€β”€ notebooks          <- Jupyter notebooks. Naming convention is a number (for ordering),
β”‚                         the creator's initials, and a short `-` delimited description,
β”‚                         e.g. `1.0-jqp-initial-data-exploration.ipynb`.
β”‚
β”œβ”€β”€ reports            <- Generated analysis as HTML, PDF, LaTeX, etc.
β”‚   └── figures            <- Generated graphics and figures to be used in reporting
β”‚
β”œβ”€β”€ configs                   <- Hydra configs
β”‚   β”œβ”€β”€ callbacks                <- Callbacks configs
β”‚   β”œβ”€β”€ data                     <- Data configs
β”‚   β”œβ”€β”€ debug                    <- Debugging configs
β”‚   β”œβ”€β”€ experiment               <- Experiment configs
β”‚   β”œβ”€β”€ extras                   <- Extra utilities configs
β”‚   β”œβ”€β”€ hparams_search           <- Hyperparameter search configs
β”‚   β”œβ”€β”€ hydra                    <- Hydra configs
β”‚   β”œβ”€β”€ local                    <- Local configs
β”‚   β”œβ”€β”€ logger                   <- Logger configs
β”‚   β”œβ”€β”€ model                    <- Model configs
β”‚   β”œβ”€β”€ paths                    <- Project paths configs
β”‚   β”œβ”€β”€ trainer                  <- Trainer configs
β”‚   β”‚
β”‚   β”œβ”€β”€ eval.yaml             <- Main config for evaluation
β”‚   └── train.yaml            <- Main config for training
β”‚
β”œβ”€β”€ src                    <- Source code
β”‚   β”œβ”€β”€ data                     <- Data scripts
β”‚   β”œβ”€β”€ models                   <- Model scripts
β”‚   β”œβ”€β”€ utils                    <- Utility scripts
β”‚   β”‚
β”‚   β”œβ”€β”€ eval.py                  <- Run evaluation
β”‚   └── train.py                 <- Run training
β”‚
β”œβ”€β”€ logs                   <- Logs generated by hydra and lightning loggers
β”‚
β”œβ”€β”€ tests                  <- Tests of any kind
β”‚
β”œβ”€β”€ .env.example              <- Example of file for storing private environment variables
β”œβ”€β”€ .gitignore                <- List of files ignored by git
β”œβ”€β”€ .pre-commit-config.yaml   <- Configuration of pre-commit hooks for code formatting
β”œβ”€β”€ .project-root             <- File for inferring the position of project root directory
β”œβ”€β”€ environment.yaml          <- File for installing conda environment
β”œβ”€β”€ Makefile                  <- Makefile with commands like `make train` or `make test`
β”œβ”€β”€ pyproject.toml            <- Configuration options for package information, testing, and linting
└── README.md

Resources

This template was inspired by:

About

PyTorch Lightning + Hydra. A very user-friendly template for ML experimentation. ⚑πŸ”₯⚑


Languages

Language:Python 97.9%Language:Makefile 1.6%Language:Shell 0.4%