Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.

Lightning-AI/tutorials

Repository files navigation

PytorchLightning Tutorials

Build Status Code formatting Deploy Docs pre-commit.ci status

This is the Lightning Library - collection of Lightning related notebooks which are pulled back to the main repo as submodule and rendered inside the main documentations. The key features/highlights:

  • we keep the repo light-weighted - notebooks are stored in rich script format
  • all scripts/notebooks are tested to be fully executable
  • fully reproducible by saving runtime env. details

Adding/Editing notebooks

This repo in main branch contain only python scripts with markdown extensions, and notebooks are generated in special publication branch, so no raw notebooks are accepted as PR. On the other hand we highly recommend creating a notebooks and convert it script with jupytext as

jupytext --set-formats ipynb,py:percent my-notebook.ipynb

Contribution structure

The addition has to formed as new folder

  • the folder name is used for the future notebooks
  • single python scripts with converted notebooks (name does not matter)
  • metadata named .meta.yaml including following info:
    title: Sample notebooks author: [User](contact) created: YYYY-MM-DD updated: YYYY-MM-DD license: CC # multi-line description: |  This notebook will walk you through ... requirements: - package # with version if needed # define supported - CPU|GPU|TPU accelerator: - CPU

Known limitations

When you want to rename folder/notebooks, it has to be split as add new and remove in two separate PRs.

Meantime notes

On the back side of publishing workflow you can find in principle these three steps

# 1) convert script to notebooks jupytext --set-formats ipynb,py:percent notebook.py # 2) testing the created notebook pytest -v notebook.ipynb --nbval # 3) generating notebooks outputs papermill in-notebook.ipynb out-notebook.ipynb

About

Collection of Pytorch lightning tutorial form as rich scripts automatically transformed to ipython notebooks.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors 33

Languages