pytorch_lighting_template
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.3%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: yangjingo
- License: apache-2.0
- Language: Python
- Default Branch: master
- Size: 15.6 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Overview
Lightning Pod is a public template for machine learning research projects using the Lightning.ai ecosystem.
It is inspired by JavaScript utilities such as CRA and CRACOS and yarn create next-app in that each of those utilities provides opinionated boilerplate that has become convention among users, making it easier for the community to navigate projects created with the same utility.
The recommended way for Lightning Pod users to create new repos is with the use this template button.
An adaptation can be found at lightning-pod-vision.
The Structure
Source Module
lightning_pod.api should contain code for model serving APIs built with FastAPI.
lightning_pod.cli should contain code for the command line interface built with Click and Rich.
lightning_pod.core should contain code for Lightning Module and Trainer.
lightning_pod.fabric should contain MixIns, Hooks, and utilities.
lightning_pod.pipeline should contain code for data acquistion and preprocessing, and building a TorchDataset and LightningDataModule.
lightning_pod.components should contain Lightning Flows and Works for use with LightningApps, grouped by purpose for cohesion.
lightning_pod.pages should contain code for data apps. the pages module concept is borrowed from React concepts. Pynecone is recommended.
lightning_pod.conf.py and lightning_pod.conf.yaml can assist with project, trainer, and sweep configurations. The .yaml file is provided for users who may want to use hydra.cc, or omegaconf with click; I prefer omegaconf and click.
Project Root
Root Directories and Files
`app.py` is the Lightning App. `assets` directory contains CSS and images for pages. `data` directory should be used to cache the TorchDataset and training splits locally if the size of the dataset allows for local storage. additionally, this directory should be used to cache predictions during HPO sweeps. `docs` directory should be used to store technical documentation. `logs` directory will store logs generated from experiment managers and profilers. `models` directory will store training checkpoints and the pre-trained ONNX model. `notebooks` directory can be used to present exploratory data analysis, explain math concepts, and create a presentation notebook to accompany a conference style paper. `requirements` directory should mirror base requirements and extras found in setup.cfg. the requirements directory and _requirements.txt_ at root are required by the basic CircleCI GitHub Action. `tests` module contains unit and integration tests targeted by pytest. `.lightning` and `.lightningignore` are used by Lightning as config files. `setup.py` `setup.cfg` `pyproject.toml` and `MANIFEST.ini` assist with packaging the Python project. `.pre-commit-config.yaml` is required by pre-commit to install its git-hooks.
Base Requirements and Extras
Lightning Pod installs minimal requirements out of the box, and provides extras to make creating robust virtual environments easier. To view the requirements, in setup.cfg, see install_requires for the base requirements and options.extras_require for the available extras.
popular alternatives are listed in the extras, and commented out to avoid installation. to use the alternatives, uncomment the line and then comment out or delete the libraries you do not want to install
The recommended install is as follows:
sh
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[full, { domain extra(s) }]"
where { domain extra(s) } is one of, or some combination of (vision, text, audio, rl, forecast) e.g.
sh
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[full, vision]"
GitHub CodeSpaces
Lightning Pod enables development with GitHub CodeSpaces. To start a new CodeSpace in your account, click the button below. Be sure to manage this CodeSpace from the CodeSpaces tab found in the navbar (the top of the page) of your GitHub account.
Learning Resources
Reviewing Source Code
The following three videos were created by Lightning's Thomas Chaton; the videos are extremely helpful in learning how to use code search features in VS Code to navigate a project's source code, enabling a deeper understanding of what is going on under the hood of someone else's code.
these videos were created before PyTorch Lightning was moved into the Lightning Framework mono repo
Lightning Codebase Deep Dive 1
Lightning Codebase Deep Dive 2
Lightning Codebase Deep Dive 3
General Engineering and Tools
Lightning's founder, and their lead educator have created a series of short videos called Lightning Bits for beginners who need guides for using IDEs, git, and terminal.
A long standing Python community resource has been The Hitchhiker's Guide to Python. The "guide exists to provide both novice and expert Python developers a best practice handbook for the installation, configuration, and usage of Python on a daily basis".
VS Code and PyCharm IDEs have each provided great docs for their users. My preference is VS Code - though PyCharm does have its benefits and is absolutely a suitable alternative to VS Code. I especially like VS Code's integrations for PyTorch and tensorboard. I pair Gitkraken and GitLens with VS Code to manage my version control and contributions.
Data Analysis
Wes McKinney, creator of Pandas and founder of Voltron Data (responsible for Ibis, Apache Arrow etc) has released his third edition of Python for Data Analysis in an open access format.
Intro to Artificial Intelligence and Mathematics for Machine Learning
Harvard University has developed an Introduction to Artificial Intelligence with Python course that can be audited for free.
Artificial Intelligence: A Modern Approach is the most widely used text on Artificial Intelligence in college courses.
Mathematics for Machine Learning provides "the necessary mathematical skills to read" books that cover advanced maching learning techniques.
Grant Sanderson, also known as 3blue1brown on YouTube, has provided a very useful, high level introduction to neural networks. Grant's other videos are also useful for computer and data science, and mathematics in general.
Deep Learning
Lightning AI's Sebastian Raschka has created a free series on Deep Learning and has shared his university lectures.
NYU's Alfredo Canziani has created a YouTube Series for his lectures on deep learning and has also made his his course materials public on GitHub.
The book Dive into Deep Learning, created by a team of Amazon engineers, is availlable for free.
DeepMind has shared several lectures series created for UCL on YouTube.
OpenAI has created Spinning Up in Deep RL, an introductory series in deep reinforcement learning.
Owner
- Name: yangjing
- Login: yangjingo
- Kind: user
- Website: yangjingo.notion.site
- Repositories: 1
- Profile: https://github.com/yangjingo
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: lastName
given-names: firstName
- name: "FirstName LastName"
title: "Project Title"
version: 0.0.1
date-released: 2022-08-06
license: "Apache-2.0"
repository-code: ""
keywords:
- machine learning
- deep learning
- artificial intelligence
GitHub Events
Total
Last Year
Dependencies
- actions/checkout v2 composite
- actions/setup-python v2 composite
- codecov/codecov-action v2 composite
- actions/checkout v3 composite
- github/codeql-action/analyze v2 composite
- github/codeql-action/autobuild v2 composite
- github/codeql-action/init v2 composite
- mcr.microsoft.com/vscode/devcontainers/python 0-${VARIANT} build
- lightning *
- torch *
- click *
- rich *
- bandit * development
- black * development
- coverage * development
- flake8 * development
- isort * development
- mypy * development
- pre-commit * development
- pytest * development
- mkdocs-material *
- mkdocstrings *
- aim *
- optuna *
- torch-tb-profiler *
- hierarchicalforecast *
- mlforecast *
- neuralforecast *
- statsforecast *
- plotly *
- pynecone *
- build *
- poetry *
- setuptools *
- twine *