---
title: Examples
canonical: 'https://lightning.ai/docs/pytorch/stable/more/tutorials'
---
# Examples {#examples}

- [Tutorial 1: Introduction to PyTorch](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/course_UvA-DL/01-introduction-to-pytorch.ipynb) — This tutorial will give a short introduction to PyTorch basics, and get you setup for writing your own neural networks. This notebook is part of a lecture se…
- [Tutorial 2: Activation Functions](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/course_UvA-DL/02-activation-functions.ipynb) — In this tutorial, we will take a closer look at (popular) activation functions and investigate their effect on optimization properties in neural networks. Ac…
- [Tutorial 3: Initialization and Optimization](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/course_UvA-DL/03-initialization-and-optimization.ipynb) — In this tutorial, we will review techniques for optimization and initialization of neural networks. When increasing the depth of neural networks, there are v…
- [Tutorial 4: Inception, ResNet and DenseNet](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/course_UvA-DL/04-inception-resnet-densenet.ipynb) — In this tutorial, we will implement and discuss variants of modern CNN architectures. There have been many different architectures been proposed over the pas…
- [Tutorial 5: Transformers and Multi-Head Attention](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/course_UvA-DL/05-transformers-and-MH-attention.ipynb) — In this tutorial, we will discuss one of the most impactful architectures of the last 2 years: the Transformer model. Since the paper Attention Is All You Ne…
- [Tutorial 6: Basics of Graph Neural Networks](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/course_UvA-DL/06-graph-neural-networks.ipynb) — In this tutorial, we will discuss the application of neural networks on graphs. Graph Neural Networks (GNNs) have recently gained increasing popularity in bo…
- [Tutorial 7: Deep Energy-Based Generative Models](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/course_UvA-DL/07-deep-energy-based-generative-models.ipynb) — In this tutorial, we will look at energy-based deep learning models, and focus on their application as generative models. Energy models have been a popular t…
- [Tutorial 8: Deep Autoencoders](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/course_UvA-DL/08-deep-autoencoders.ipynb) — In this tutorial, we will take a closer look at autoencoders (AE). Autoencoders are trained on encoding input data such as images into a smaller feature vect…
- [Tutorial 9: Normalizing Flows for Image Modeling](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/course_UvA-DL/09-normalizing-flows.ipynb) — In this tutorial, we will take a closer look at complex, deep normalizing flows. The most popular, current application of deep normalizing flows is to model …
- [Tutorial 10: Autoregressive Image Modeling](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/course_UvA-DL/10-autoregressive-image-modeling.ipynb) — In this tutorial, we implement an autoregressive likelihood model for the task of image modeling. Autoregressive models are naturally strong generative model…
- [Tutorial 11: Vision Transformers](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/course_UvA-DL/11-vision-transformer.ipynb) — In this tutorial, we will take a closer look at a recent new trend: Transformers for Computer Vision. Since [Alexey Dosovitskiy et al.](https://openreview.ne…
- [Tutorial 12: Meta-Learning - Learning to Learn](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/course_UvA-DL/12-meta-learning.ipynb) — In this tutorial, we will discuss algorithms that learn models which can quickly adapt to new classes and/or tasks with few samples. This area of machine lea…
- [Tutorial 13: Self-Supervised Contrastive Learning with SimCLR](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/course_UvA-DL/13-contrastive-learning.ipynb) — In this tutorial, we will take a closer look at self-supervised contrastive learning. Self-supervised learning, or also sometimes called unsupervised learnin…
- [GPU and batched data augmentation with Kornia and PyTorch-Lightning](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/lightning_examples/augmentation_kornia.ipynb) — In this tutorial we will show how to combine both Kornia and PyTorch Lightning to perform efficient data augmentation to train a simple model using the GPU i…
- [Barlow Twins Tutorial](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/lightning_examples/barlow-twins.ipynb) — This notebook describes the self-supervised learning method Barlow Twins. Barlow Twins differs from other recently proposed algorithms as it doesn't fall und…
- [PyTorch Lightning Basic GAN Tutorial](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/lightning_examples/basic-gan.ipynb) — How to train a GAN! Main takeaways: 1. Generator and discriminator are arbitrary PyTorch modules. 2. training_step does both the generator and discriminator …
- [PyTorch Lightning CIFAR10 ~94% Baseline Tutorial](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/lightning_examples/cifar10-baseline.ipynb) — Train a Resnet to 94% accuracy on Cifar10!
- [PyTorch Lightning DataModules](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/lightning_examples/datamodules.ipynb) — This notebook will walk you through how to start using Datamodules. With the release of `pytorch-lightning` version 0.9.0, we have included a new class calle…
- [Fine-Tuning Scheduler](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/lightning_examples/finetuning-scheduler.ipynb) — This notebook introduces the [Fine-Tuning Scheduler](https://finetuning-scheduler.readthedocs.io/en/stable/index.html) extension and demonstrates the use of …
- [Introduction to PyTorch Lightning](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/lightning_examples/mnist-hello-world.ipynb) — In this notebook, we'll go over the basics of lightning by preparing models to train on the [MNIST Handwritten Digits dataset](https://en.wikipedia.org/wiki/…
- [TPU training with PyTorch Lightning](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/lightning_examples/mnist-tpu-training.ipynb) — In this notebook, we'll train a model on TPUs. Updating one Trainer flag is all you need for that. The most up to documentation related to TPU training can b…
- [How to train a Deep Q Network](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/lightning_examples/reinforce-learning-DQN.ipynb) — Main takeaways: 1. RL has the same flow as previous models we have seen, with a few additions 2. Handle unsupervised learning by using an IterableDataset whe…
- [Finetune Transformers Models with PyTorch Lightning](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/lightning_examples/text-transformers.ipynb) — This notebook will use HuggingFace's `datasets` library to get data, which will be wrapped in a `LightningDataModule`. Then, we write a class to perform text…
- [How to write a PyTorch Lightning tutorial](https://github.com/Lightning-AI/tutorials/blob/69112e6fe73b50d159c4b7add6ddea412b458691/.notebooks/templates/simple.ipynb) — This is a template to show how to contribute a tutorial.

---

**Navigation**

- Parent: [More](/docs/pytorch/2.6.6/more.md)
