Skip to content

Commit 9dd5c72

Browse files
committed
0 parents  commit 9dd5c72

File tree

362 files changed

+31449
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

362 files changed

+31449
-0
lines changed

โ€Ž.gitignoreโ€Ž

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# project
2+
.DS_Store
3+
run_configs/
4+
model_weights/
5+
app/models/
6+
pip-wheel-metadata/
7+
lightning_logs/
8+
.vscode/
9+
10+
# Test-tube
11+
test_tube_*/
12+
13+
# Documentations
14+
docs/source/api
15+
docs/source/*.md
16+
docs/source/generated
17+
docs/source/*/generated
18+
docs/source/notebooks
19+
docs/source/_static/images/course_UvA-DL
20+
docs/source/_static/images/lightning_examples
21+
22+
# Byte-compiled / optimized / DLL files
23+
__pycache__/
24+
*.py[cod]
25+
*$py.class
26+
timit_data/
27+
grid_generated*
28+
grid_ori*
29+
30+
31+
32+
# C extensions
33+
*.so
34+
35+
# PyCharm
36+
.idea/
37+
38+
# Distribution / packaging
39+
.Python
40+
ide_layouts/
41+
build/
42+
_build/
43+
develop-eggs/
44+
dist/
45+
downloads/
46+
eggs/
47+
.eggs/
48+
lib/
49+
lib64/
50+
parts/
51+
sdist/
52+
wheels/
53+
*.egg-info/
54+
.installed.cfg
55+
*.egg
56+
57+
# PyInstaller
58+
# Usually these files are written by a python script from a template
59+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
60+
*.manifest
61+
*.spec
62+
63+
# Installer logs
64+
pip-log.txt
65+
pip-delete-this-directory.txt
66+
67+
# Unit test / coverage reports
68+
htmlcov/
69+
.tox/
70+
.coverage
71+
.coverage.*
72+
.cache
73+
nosetests.xml
74+
coverage.xml
75+
*.cover
76+
.hypothesis/
77+
tests/tests_tt_dir/
78+
tests/save_dir
79+
tests/tests/
80+
81+
# Translations
82+
*.mo
83+
*.pot
84+
85+
# Django stuff:
86+
*.log
87+
local_settings.py
88+
89+
# Flask stuff:
90+
instance/
91+
.webassets-cache
92+
93+
# Scrapy stuff:
94+
.scrapy
95+
96+
# Sphinx documentation
97+
docs/build/
98+
99+
# PyBuilder
100+
target/
101+
102+
# Jupyter Notebook
103+
.ipynb_checkpoints
104+
105+
# pyenv
106+
.python-version
107+
108+
# celery beat schedule file
109+
celerybeat-schedule
110+
111+
# SageMath parsed files
112+
*.sage.py
113+
114+
# dotenv
115+
.env
116+
117+
# virtualenv
118+
.venv
119+
env/
120+
venv/
121+
ENV/
122+
123+
# Spyder project settings
124+
.spyderproject
125+
.spyproject
126+
127+
# Rope project settings
128+
.ropeproject
129+
130+
# mkdocs documentation
131+
/site
132+
133+
# mypy
134+
.mypy_cache/
135+
# pytest
136+
.pytest_cache/
137+
138+
# data
139+
.data/
140+
Datasets/
141+
mnist/
142+
MNIST/
143+
legacy/checkpoints/
144+
*.gz
145+
*ubyte
146+
147+
# pl tests
148+
ml-runs/
149+
mlruns/
150+
*.zip
151+
*.ckpt
152+
pytorch\ lightning
153+
test-reports/
154+
wandb
155+
.forked/
156+
*.prof
157+
*.tar.gz
158+
.neptune/
159+
160+
# dataset generated from bolts in examples.
161+
cifar-10-batches-py
162+
*.pt
163+
# ctags
164+
tags
165+
.tags

โ€ŽMakefileโ€Ž

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SOURCEDIR = source
8+
BUILDDIR = build
9+
10+
# Put it first so that "make" without argument is like "make help".
11+
help:
12+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13+
14+
.PHONY: help Makefile
15+
16+
# Catch-all target: route all unknown targets to Sphinx using the new
17+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
18+
%: Makefile
19+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

โ€ŽREADME.mdโ€Ž

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# PyTorch-Lightning Docs
2+
3+
We are using Sphinx with Napoleon extension.
4+
Moreover, we set Google style to follow with type convention.
5+
6+
- [Napoleon formatting with Google style](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)
7+
- [ReStructured Text (reST)](https://docs.pylonsproject.org/projects/docs-style-guide/)
8+
- [Paragraph-level markup](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#paragraphs)
9+
10+
See following short example of a sample function taking one position string and optional
11+
12+
```python
13+
from typing import Optional
14+
15+
16+
def my_func(param_a: int, param_b: Optional[float] = None) -> str:
17+
"""Sample function.
18+
19+
Args:
20+
param_a: first parameter
21+
param_b: second parameter
22+
23+
Return:
24+
sum of both numbers
25+
26+
Example::
27+
28+
>>> my_func(1, 2)
29+
3
30+
31+
Note:
32+
If you want to add something.
33+
"""
34+
p = param_b if param_b else 0
35+
return str(param_a + p)
36+
```
37+
38+
## Building Docs
39+
40+
When updating the docs, make sure to build them first locally and visually inspect the html files in your browser for
41+
formatting errors. In certain cases, a missing blank line or a wrong indent can lead to a broken layout.
42+
Run these commands
43+
44+
```bash
45+
git submodule update --init --recursive
46+
pip install -r requirements/docs.txt
47+
make clean
48+
cd docs
49+
make html
50+
```
51+
52+
and open `docs/build/html/index.html` in your browser.
53+
54+
When you send a PR the continuous integration will run tests and build the docs. You can access a preview of the html pages in the
55+
_Artifacts_ tab in CircleCI when you click on the task named _build-Docs_ of _ci-tests_ at the bottom of the PR page.
56+
57+
Notes (Optional):
58+
59+
- You need to have LaTeX installed for rendering math equations. You can for example install TeXLive by doing one of the following:
60+
- on Ubuntu (Linux) run `apt-get install texlive` or otherwise follow the instructions on the TeXLive website
61+
- use the [RTD docker image](https://hub.docker.com/r/readthedocs/build)
62+
63+
## Developing docs
64+
65+
When developing the docs, building docs can be VERY slow locally because of the notebook tutorials.
66+
To speed this up, enable this flag in before building docs:
67+
68+
```bash
69+
# builds notebooks which is slow
70+
export PL_FAST_DOCS_DEV=0
71+
72+
# fast notebook build which is fast
73+
export PL_FAST_DOCS_DEV=1
74+
```
75+
76+
## docs CSS/theme
77+
78+
To change the CSS theme of the docs, go [here](https://github.com/PyTorchLightning/lightning_sphinx_theme).
79+
Apologies in advance... this is a bit complex to build and requires basic understanding of javascript/npm.

โ€Ž__about__.pyโ€Ž

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import time
2+
3+
_this_year = time.strftime("%Y")
4+
__version__ = "1.7.0dev"
5+
__author__ = "William Falcon et al."
6+
__author_email__ = "waf2107@columbia.edu"
7+
__license__ = "Apache-2.0"
8+
__copyright__ = f"Copyright (c) 2018-{_this_year}, {__author__}."
9+
__homepage__ = "https://github.com/PyTorchLightning/pytorch-lightning"
10+
__docs_url__ = "https://pytorch-lightning.readthedocs.io/en/stable/"
11+
# this has to be simple string, see: https://github.com/pypa/twine/issues/522
12+
__docs__ = (
13+
"PyTorch Lightning is the lightweight PyTorch wrapper for ML researchers."
14+
" Scale your models. Write less boilerplate."
15+
)
16+
__long_docs__ = """
17+
Lightning is a way to organize your PyTorch code to decouple the science code from the engineering.
18+
It's more of a style-guide than a framework.
19+
20+
In Lightning, you organize your code into 3 distinct categories:
21+
22+
1. Research code (goes in the LightningModule).
23+
2. Engineering code (you delete, and is handled by the Trainer).
24+
3. Non-essential research code (logging, etc. this goes in Callbacks).
25+
26+
Although your research/production project might start simple, once you add things like GPU AND TPU training,
27+
16-bit precision, etc, you end up spending more time engineering than researching.
28+
Lightning automates AND rigorously tests those parts for you.
29+
30+
Overall, Lightning guarantees rigorously tested, correct, modern best practices for the automated parts.
31+
32+
Documentation
33+
-------------
34+
- https://pytorch-lightning.readthedocs.io/en/latest
35+
- https://pytorch-lightning.readthedocs.io/en/stable
36+
"""
37+
38+
__all__ = ["__author__", "__author_email__", "__copyright__", "__docs__", "__homepage__", "__license__", "__version__"]

โ€Žmake.batโ€Ž

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
33+
34+
:end
35+
popd

0 commit comments

Comments
ย (0)