* add neptune integration

* improve readme

* quick fix
This commit is contained in:
Lucas authored and GitHub committed 2021-01-29 20:59:04 +01:00
1 parent 3002778f68
commit f4e0c3a75f
11 files changed
+34 -34

No files matched your search

+13 -21
View File
@@ -1,9 +1,11 @@
## Lightning + Hydra template for Deep Learning projects
This is my starting template and pipeline for most deep learning projects.<br>
Built with <b>PyTorch Lightning</b> and <b>Hydra</b>.<br>
Also contains special <b>Weights&Biases</b> integration, but can be used with any other logger.<br>
## PyTorch Lightning + Hydra template 🚀⚡🔥
A clean and simple template and pipeline to kickstart your deep learning project!<br>
It's supposed to be enchancement/expansion on original [deep-learninig-project-template](https://github.com/PyTorchLightning/deep-learning-project-template) repository.<br>
<b>[PyTorch Lightning](https://github.com/PyTorchLightning/pytorch-lightning)</b> provides great abstractions for well structured ML code and advanced features like checkpointing and gradient accumulation.<br>
<b>[Hydra](https://github.com/facebookresearch/hydra)</b> provides convenient way to manage experiment configurations (see examples below).<br>
Also available extra <b>[Weights&Biases](https://www.wandb.com/)</b> utilites, but template can be used with any other logger.<br>
It's supposed to be extended version of [deep-learninig-project-template](https://github.com/PyTorchLightning/deep-learning-project-template) repository.<br>
I'm trying to make this as generic as possible - you should be able to easily modify behavior in [train.py](project/train.py) file in case you need some unconventional configuration wiring.<br>
The goal is to:
@@ -20,21 +22,21 @@ Click on <b>`Use this template`</b> button above to initialize new repository.<b
## Features
- Predefined folder structure
- Modularity: all abstractions are splitted into different submodules
- Automates training with PyTorch Lightning
- You only need to create model and datamodule and specify them in configuration files
- You only need to create model and datamodule and specify them in config and you can already run training
- All advantages of Hydra
- Main config file contains default training configuration ([config.yaml](project/configs/config.yaml))
- Storing many experiment configurations in a convenient way ([project/configs/experiment](project/configs/experiment))
- Composing configuration files out of other configuration files
- Scheduling execution of many experiments from command line
- Overriding any config parameter from command line
- Scheduling execution of many experiments from command line
- Sweeping over hyperparameters from command line
- Command line tab completion
- Logging history of all executed runs/experiments
- ~~Automatically validate config structure with config schemas~~ (TODO)
- Weights&Biases integration
- optional Weights&Biases utilities for experiment tracking
- Available callbacks that store all code files and model checkpoints as artifacts in Weights&Biases cloud ([wandb_callbacks.py](project/src/callbacks/wandb_callbacks.py))
- Example wandb callbacks for generating confusion matrices and f1/precision/recall heatmaps ([wandb_callbacks.py](project/src/callbacks/wandb_callbacks.py))
- Automatically watches the model
- ~~Hyperparameter search with Weights&Biases sweeps ([execute_sweep.py](project/template_utils/execute_sweep.py))~~ (TODO)
- Example of inference with trained model ([inference_example.py](project/src/utils/inference_example.py))
- Built in requirements ([requirements.txt](requirements.txt))
@@ -351,7 +353,7 @@ To create a sweep over some hyperparameters run:
python train.py --multirun datamodule.batch_size=32,64,128 model.lr=0.001,0.0005
```
## Import
## Installing project as a package
Optionally you can install project as a package with [setup.py](setup.py):
```yaml
pip install -e .
@@ -362,13 +364,3 @@ from project.src.datasets.img_test_dataset import TestDataset
from project.src.models.mnist_model import LitModelMNIST
from project.src.datamodules.mnist_datamodule import MNISTDataModule
```
## Citation
```
@article{YourName,
title={Your Title},
author={Your team},
journal={Location},
year={Year}
}
```