From f3d517deb5146dbb8d772817397e9fed354edd93 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 15 Jan 2020 19:44:02 -0500 Subject: [PATCH] updated docs --- docs/source/conf.py | 1 + docs/source/index.rst | 8 ++++---- docs/source/new-project.rst | 18 +++++++++++------- pytorch_lightning/trainer/__init__.py | 6 +++++- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index da0774a1..fa3558ab 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -83,6 +83,7 @@ extensions = [ 'sphinx.ext.autosummary', 'sphinx.ext.napoleon', 'recommonmark', + 'sphinx.ext.autosectionlabel', # 'm2r', 'nbsphinx', ] diff --git a/docs/source/index.rst b/docs/source/index.rst index 0dd7a6af..2fde388c 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,13 +3,13 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to PyTorch-Lightning! +PyTorch-Lightning Documentation ============================= .. toctree:: - :maxdepth: 4 + :maxdepth: 1 :name: start - :caption: Quick Start + :caption: Start Here new-project examples @@ -17,7 +17,7 @@ Welcome to PyTorch-Lightning! .. toctree:: :maxdepth: 4 :name: docs - :caption: Docs + :caption: Python API documentation diff --git a/docs/source/new-project.rst b/docs/source/new-project.rst index 448e7e38..3bf8e3d4 100644 --- a/docs/source/new-project.rst +++ b/docs/source/new-project.rst @@ -1,13 +1,13 @@ Quick Start =========== -To start a new project define two files, a LightningModule and a Trainer file. -To illustrate Lightning power and simplicity, here's an example of a typical research flow. +| To start a new project define two files, a LightningModule and a Trainer file. +| To illustrate the power of Lightning and its simplicity, here's an example of a typical research flow. Case 1: BERT ------------ -Let's say you're working on something like BERT but want to try different ways of training or even different networks. -You would define a single LightningModule and use flags to switch between your different ideas. +| Let's say you're working on something like BERT but want to try different ways of training or even different networks. +| You would define a single LightningModule and use flags to switch between your different ideas. .. code-block:: python @@ -66,6 +66,10 @@ Then you could do rapid research by switching between these two and using the sa **Notice a few things about this flow:** -1. You're writing pure PyTorch... no unnecessary abstractions or new libraries to learn. -2. You get free GPU and 16-bit support without writing any of that code in your model. -3. You also get all of the capabilities below (without coding or testing yourself). +1. You're writing pure PyTorch... no unnecessary abstractions or new libraries to learn. +2. You get free GPU and 16-bit support without writing any of that code in your model. +3. You also get all of the capabilities below (without coding or testing yourself). + +- :ref:`Examples & Tutorials` +- :ref:`Examples & Tutorials` +- :ref:`Examples & Tutorials` diff --git a/pytorch_lightning/trainer/__init__.py b/pytorch_lightning/trainer/__init__.py index 88087a24..96254c26 100644 --- a/pytorch_lightning/trainer/__init__.py +++ b/pytorch_lightning/trainer/__init__.py @@ -16,4 +16,8 @@ This is the basic use of the trainer: trainer = Trainer() trainer.fit(model) -""" +The Trainer holds all the engineering code you might need such as distributing over GPUs or early stopping. +The LightningTemplate holds the core computations, train, val, test loop, optimizer and dataloaders. + +This pattern de-couples the engineering from the science which makes your code reusable and free to run on any hardware. +""" \ No newline at end of file