Our most robust examples showing all sorts of implementations can be found in our sister library Lightning Bolts.
5 MNIST examples showing how to gradually convert from pure PyTorch to PyTorch Lightning.
The transition through LightningLite from pure PyTorch is optional but it might be helpful to learn about it.
- MNIST with vanilla PyTorch
- MNIST with LightningLite
- MNIST LightningLite to LightningModule
- MNIST with LightningModule
- MNIST with LightningModule + LightningDataModule
In this folder, we have 2 simple examples:
- Image Classifier (trains arbitrary datasets with arbitrary backbones).
- Image Classifier + DALI (defines the model inside the
LightningModule
). - Autoencoder
This folder contains older examples. You should instead use the examples in Lightning Bolts for advanced use cases.
In this folder, we have 1 simple example:
- Image Classifier + DALI (defines the model inside the
LightningModule
).
Contains implementations leveraging loop customization to enhance the Trainer with new optimization routines.
- K-fold Cross Validation Loop: Implemenation of cross validation in a loop and special datamodule.
- Yield Loop: Enables yielding from the training_step like in a Python generator. Useful for automatic optimization with multiple optimizers.