Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ Lightning sets up all the boilerplate state-of-the-art training for you so you c
---

## How do I do use it?
Think about Lightning as refactoring your research code instead of using a new framework. The research code goes into a [LightningModule](https://pytorch-lightning.rtfd.io/en/latest/LightningModule/RequiredTrainerInterface/) which you fit using a Trainer.
Think about Lightning as refactoring your research code instead of using a new framework. The research code goes into a [LightningModule](https://pytorch-lightning.rtfd.io/en/latest/lightning-module.html) which you fit using a Trainer.

The LightningModule defines a *system* such as seq-2-seq, GAN, etc... It can ALSO define a simple classifier such as the example below.

To use lightning do 2 things:
1. [Define a LightningModule](https://pytorch-lightning.rtfd.io/en/latest/LightningModule/RequiredTrainerInterface/)
1. [Define a LightningModule](https://pytorch-lightning.rtfd.io/en/latest/lightning-module.html)
**WARNING:** This syntax is for version 0.5.0+ where abbreviations were removed.
```python
import os
Expand Down Expand Up @@ -165,7 +165,7 @@ To use lightning do 2 things:
# OPTIONAL
return DataLoader(MNIST(os.getcwd(), train=False, download=True, transform=transforms.ToTensor()), batch_size=32)
```
2. Fit with a [trainer](https://pytorch-lightning.rtfd.io/en/latest/Trainer/)
2. Fit with a [trainer](https://pytorch-lightning.rtfd.io/en/latest/pytorch_lightning.trainer.html)
```python
from pytorch_lightning import Trainer

Expand Down
92 changes: 80 additions & 12 deletions docs/source/_static/images/lightning_logo-name.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def find_source():
obj = getattr(obj, part)
fname = inspect.getsourcefile(obj)
# https://github.com/rtfd/readthedocs.org/issues/5735
if any([s in fname for s in ('readthedocs', 'checkouts')]):
if any([s in fname for s in ('readthedocs', 'rtfd', 'checkouts')]):
# /home/docs/checkouts/readthedocs.org/user_builds/pytorch_lightning/checkouts/
# devel/pytorch_lightning/utilities/cls_experiment.py#L26-L176
path_top = os.path.abspath(os.path.join('..', '..', '..'))
Expand All @@ -338,6 +338,10 @@ def find_source():
# import subprocess
# tag = subprocess.Popen(['git', 'rev-parse', 'HEAD'], stdout=subprocess.PIPE,
# universal_newlines=True).communicate()[0][:-1]
branch = filename.split('/')[0]
# do mapping from latest tags to master
branch = {'latest': 'master', 'stable': 'master'}.get(branch, branch)
filename = '/'.join([branch] + filename.split('/')[1:])
return "https://github.com/%s/%s/blob/%s" \
% (github_user, github_repo, filename)

Expand Down
10 changes: 5 additions & 5 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
GAN
====
===
.. toctree::
:maxdepth: 3

pl_examples.domain_templates.gan

MNIST
====
=====
.. toctree::
:maxdepth: 3

pl_examples.basic_examples.lightning_module_template

Multi-node (ddp) MNIST
====
======================
.. toctree::
:maxdepth: 3

pl_examples.multi_node_examples.multi_node_ddp_demo

Multi-node (ddp2) MNIST
====
=======================
.. toctree::
:maxdepth: 3

pl_examples.multi_node_examples.multi_node_ddp2_demo

Imagenet
====
========
.. toctree::
:maxdepth: 3

Expand Down
3 changes: 2 additions & 1 deletion pytorch_lightning/callbacks/pt_callbacks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Callbacks
====================================
=========

Callbacks supported by Lightning
"""

Expand Down
1 change: 1 addition & 0 deletions pytorch_lightning/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def test_dataloader(self):
Once you've defined the LightningModule, fit it using a trainer.

.. code-block:: python

trainer = pl.Trainer()
model = CoolModel()

Expand Down
1 change: 1 addition & 0 deletions pytorch_lightning/logging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
To use a logger, simply pass it into the trainer.

.. code-block:: python

from pytorch_lightning import logging

# lightning uses tensorboard by default
Expand Down
2 changes: 1 addition & 1 deletion pytorch_lightning/logging/test_tube.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class TestTubeLogger(LightningLoggerBase):
`os.path.join(save_dir, name, version)`

Example
--------
-------

.. code-block:: python

Expand Down
Loading