Watch out for the (PyTorch) Lightning
Tags: python, machinelearning, deeplearning, beginners
Published: 2022-05-03 01:13:33

## Table of Contents <a name="TOC">
1. [What is PyTorch Lightning](#what-is-pytorch-lightning)
2. [Installing and Getting Started](#installing-and-getting-started)
3. [Learning with Lighting](#learning-with-lightning)
4. [Grid AI](#grid-ai)
5. [Helpful Links](#helpful-links)


### What is [PyTorch Lightning](https://www.pytorchlightning.ai/)

{% embed https://www.youtube.com/watch?v=Hgg8Xy6IRig %}

Turn PyTorch code into Lightning code.

PyTorch Code of model:
![py model](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hpgouwsbjc5smb5710ak.png)

Lightning Code of model:
![lightning model](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/avpr3vvxv3l5ytfb1r9s.png)
 
PyTorch Code of training:
![py train](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xs9kkvw4i32wend1ix4f.png)

Lightning Code of training:
![lightning train](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z0ul2r6wiwvk3p1cjhft.png)

More about PyTorch here:

{% embed https://dev.to/tmchuynh/introduction-to-pytorch-25k3 %}

[Back to TOC](#TOC)
 
### Installing and Getting Started

#### Install PyTorch Lightning by running:

```
pip install pytorch-lightning
```

or

```
conda install pytorch-lightning -c conda-forge
```

#### [Lighting in 15 Minutes](https://pytorch-lightning.readthedocs.io/en/latest/starter/introduction.html)

PyTorch Lighting's documentation has skill levels you are able to walk through, each teaching you a new skill.
Level 1: Train a model
Level 2: Add a validation and test set
Level 3: Use pretrained models
Level 4: Enable script parameters
.
.
Level 10: Understand your model
Level 11: Explore SOTA scaling techniques
.
.
Level 20: Explore HPUs
Level 21: Master TPUs
Level 22: Reach 1 trillion parameters on GPUs
.
.
.
Level 26: Make your own profiler

### [Learning with Lighting](https://www.pytorchlightning.ai/tutorials)

There are many tutorials and other resources on PyTorch Lighting's website you can utilize to start your journey with Lighting.

#### [Tutorials](https://www.pytorchlightning.ai/tutorials)

#### [Glossary](https://pytorch-lightning.readthedocs.io/en/latest/extensions/accelerator.html)

#### [Common WorkFlows](https://pytorch-lightning.readthedocs.io/en/latest/model/build_model.html)

#### Slack Community

Join their [Slack](https://join.slack.com/t/pytorch-lightning/shared_invite/zt-12iz3cds1-uyyyBYJLiaL2bqVmMN7n~A) to ask the community questions and check out the [GitHub here](https://github.com/PyTorchLightning/pytorch-lightning).


### Grid AI
From the creators of PyTorch Lighting, you can get started with grid and train countless of ML models from your laptop with zero code changes!

Introducing [Grid AI](https://www.grid.ai/)

### Helpful Links
- [PyTorch Lightning MasterClass](https://www.youtube.com/playlist?list=PLaMu-SDt_RB5NUm67hU2pdE75j6KaIOv2)
- [Lightning Research Talks](https://www.youtube.com/playlist?list=PLaMu-SDt_RB4k8VXiB3hOdsn0Y3GoXo1k)
- [Getting Started with PyTorch Lightning](https://www.exxactcorp.com/blog/Deep-Learning/getting-started-with-pytorch-lightning)
- [PyTorch Ecosystem](https://pytorch.org/ecosystem/)
- [PyTorch Lightning for Dummies](https://www.assemblyai.com/blog/pytorch-lightning-for-dummies/)
- [Training Neural Networks using PyTorch Lightning](https://www.geeksforgeeks.org/training-neural-networks-using-pytorch-lightning/)

Happy coding!