Compare commits

...
159 Commits
Author SHA1 Message Date
William Falcon 2260476a52 Merge branch 'master' into clean_docs 2020-01-21 14:55:49 -05:00
William Falcon bc4cd3d69a Update theme_variables.jinja 2020-01-21 14:18:43 -05:00
William Falcon 8e5e227152 flake 8 2020-01-21 14:16:55 -05:00
William Falcon f6f078c085 merged 2020-01-21 14:15:52 -05:00
William Falcon a53e6aa67b fix docs path 2020-01-21 14:12:02 -05:00
William Falcon 3bb91bad99 flake 8 2020-01-21 14:11:42 -05:00
William Falcon 8ad6623ab6 flake 8 2020-01-21 14:11:20 -05:00
William Falcon a962c03f31 added loggers 2020-01-21 14:10:35 -05:00
William Falcon 23b0a746b3 added loggers 2020-01-21 14:10:06 -05:00
William Falcon 7c048d3cf5 added loggers 2020-01-21 14:09:12 -05:00
William Falcon e9498b2241 added loggers 2020-01-21 14:08:55 -05:00
William Falcon 20efe6cf3a added loggers 2020-01-21 14:08:29 -05:00
William Falcon 44d844022f added loggers 2020-01-21 14:08:15 -05:00
William Falcon 37b0cd5bd2 added loggers 2020-01-21 14:07:53 -05:00
William Falcon aae963a186 added loggers 2020-01-21 14:07:44 -05:00
William Falcon 94943afcb8 added loggers 2020-01-21 14:07:16 -05:00
William Falcon 588fd516a1 added loggers 2020-01-21 14:07:16 -05:00
William Falcon cd1429b587 added loggers 2020-01-21 14:06:03 -05:00
William Falcon db72ece7bb added callbacks 2020-01-21 14:05:23 -05:00
William Falcon d8e112d4e2 finished lightning module 2020-01-21 14:04:58 -05:00
William Falcon b351496001 finished lightning module 2020-01-21 14:04:48 -05:00
William Falcon 150a94543c finished lightning module 2020-01-21 14:04:35 -05:00
William Falcon 8258d9c1c2 finished lightning module 2020-01-21 14:03:54 -05:00
William Falcon 5e38ab259e cleared spaces 2020-01-21 14:03:38 -05:00
William Falcon 95df5e73d9 cleared spaces 2020-01-21 14:03:13 -05:00
William Falcon 22bd7dc920 cleared spaces 2020-01-21 14:02:54 -05:00
William Falcon ef3fe53801 cleared spaces 2020-01-21 14:02:25 -05:00
William Falcon a01f685672 cleared spaces 2020-01-21 14:01:56 -05:00
William Falcon b7e861d93d fixed lightning import 2020-01-21 14:01:09 -05:00
William Falcon 8649ae65b8 working on trainer docs 2020-01-21 13:59:42 -05:00
William Falcon 155fb07848 working on trainer docs 2020-01-21 13:57:12 -05:00
William Falcon d102f735d3 working on trainer docs 2020-01-21 13:56:45 -05:00
William Falcon 4cdcdf7688 working on trainer docs 2020-01-21 13:56:29 -05:00
William Falcon 309888e403 working on trainer docs 2020-01-21 13:56:01 -05:00
William Falcon aa2d5d0efa working on trainer docs 2020-01-21 13:55:43 -05:00
William Falcon 53f57e4caa working on trainer docs 2020-01-21 13:55:32 -05:00
William Falcon 9983a28b24 set auto dp if no backend 2020-01-21 13:55:04 -05:00
William Falcon 3e603572a2 working on trainer docs 2020-01-21 13:54:39 -05:00
William Falcon 101099f1fd working on trainer docs 2020-01-21 13:54:26 -05:00
William Falcon 44f50683fd working on trainer docs 2020-01-21 13:54:10 -05:00
William Falcon fbd0f0bce1 working on trainer docs 2020-01-21 13:52:46 -05:00
William Falcon 4c593df2d6 working on trainer docs 2020-01-21 13:51:59 -05:00
William Falcon 3fae45c8c4 working on trainer docs 2020-01-21 13:51:02 -05:00
William Falcon 3f7ed8aa16 making private members 2020-01-21 13:50:11 -05:00
William Falcon 56fb889d81 making private members 2020-01-21 13:49:21 -05:00
William Falcon 4f7af2157b making private members 2020-01-21 13:49:21 -05:00
William Falcon acfffe1822 finished rebase 2020-01-21 13:49:21 -05:00
William Falcon 333cd2dd67 added direct links to docs 2020-01-21 13:48:59 -05:00
William Falcon b3c51b89d5 added direct links to docs 2020-01-21 13:48:40 -05:00
William Falcon 792706a345 added direct links to docs 2020-01-21 13:47:36 -05:00
William Falcon f8a84d275b added direct links to docs 2020-01-21 13:46:20 -05:00
William Falcon 124aaa00e1 added direct links to docs 2020-01-21 13:45:44 -05:00
William Falcon fd8bd4e5eb added direct links to docs 2020-01-21 13:45:18 -05:00
William Falcon 45cbf15223 added callbacks to menu 2020-01-21 13:44:55 -05:00
William Falcon c0148d73a4 fixed left menu 2020-01-21 13:44:26 -05:00
William Falcon dde99dfb7a finished callbacks 2020-01-21 13:42:58 -05:00
William Falcon 16956692f0 finished callbacks 2020-01-21 13:42:35 -05:00
William Falcon 2b258a6813 finished callbacks 2020-01-21 13:42:04 -05:00
William Falcon 50c58c71d3 updated docs 2020-01-21 13:41:18 -05:00
William Falcon 8288e4ebf8 updated gitignore 2020-01-21 13:40:09 -05:00
William Falcon 42951f2112 added direct links to docs 2020-01-21 13:39:44 -05:00
William Falcon ce8b7197ce added direct links to docs 2020-01-21 13:39:27 -05:00
William Falcon 179515083e added direct links to docs 2020-01-21 13:35:42 -05:00
William Falcon 6a2e00bac4 added direct links to docs 2020-01-21 13:34:52 -05:00
William Falcon f52aec9766 added direct links to docs 2020-01-21 13:33:32 -05:00
William Falcon 7bb78c991f added direct links to docs 2020-01-21 13:32:24 -05:00
William Falcon 805de07345 added callbacks to menu 2020-01-21 13:32:13 -05:00
William Falcon b9e0898102 fixed left menu 2020-01-21 13:31:36 -05:00
William Falcon 23cb27c887 finished callbacks 2020-01-21 13:28:41 -05:00
William Falcon 1a0437e410 finished callbacks 2020-01-21 13:27:58 -05:00
William Falcon 55a305e43c finished callbacks 2020-01-21 13:27:19 -05:00
William Falcon 839c9da5b5 updated docs 2020-01-21 13:25:44 -05:00
William Falcon ed41c77e7b updated links in ninja file 2020-01-21 13:24:00 -05:00
William Falcon a26c95bbf1 updated gitignore 2020-01-21 13:23:05 -05:00
William Falcon 8ae4132917 updated gitignore 2020-01-21 13:22:08 -05:00
William Falcon 55062ad926 fix docs path 2020-01-21 13:20:55 -05:00
William Falcon c6c4492475 flake 8 2020-01-17 05:31:16 -05:00
William Falcon 57db191028 flake 8 2020-01-17 05:03:31 -05:00
William Falcon f02d0bcbb9 added loggers 2020-01-16 18:08:04 -05:00
William Falcon 22b203d71b added loggers 2020-01-16 17:42:24 -05:00
William Falcon 1e2a37d6d4 added loggers 2020-01-16 17:42:12 -05:00
William Falcon 8bff7e38da added loggers 2020-01-16 17:41:11 -05:00
William Falcon a66f56abf2 added loggers 2020-01-16 17:39:09 -05:00
William Falcon 6c0debf1e3 added loggers 2020-01-16 17:37:43 -05:00
William Falcon c3d3c47554 set auto dp if no backend 2020-01-16 17:36:05 -05:00
William Falcon 438708c33d added loggers 2020-01-16 17:35:02 -05:00
William Falcon f82def41f2 added loggers 2020-01-16 17:29:13 -05:00
William Falcon 48d1df042d added loggers 2020-01-16 17:24:41 -05:00
William Falcon 83a233e691 added loggers 2020-01-16 17:24:03 -05:00
William Falcon ae3dbf556d added loggers 2020-01-16 17:20:52 -05:00
William Falcon 67a8644c96 added loggers 2020-01-16 17:19:40 -05:00
William Falcon 275ebdcc51 added loggers 2020-01-16 17:19:07 -05:00
William Falcon 21f6c8b6e0 added loggers 2020-01-16 17:06:32 -05:00
William Falcon 938bb4a837 added callbacks 2020-01-16 17:02:25 -05:00
William Falcon f162fd1e95 finished lightning module 2020-01-16 16:51:23 -05:00
William Falcon 00d5285ce4 finished lightning module 2020-01-16 16:50:54 -05:00
William Falcon 070d008bd0 finished lightning module 2020-01-16 16:50:05 -05:00
William Falcon 94018d49f2 finished lightning module 2020-01-16 16:43:44 -05:00
William Falcon de32a72c97 cleared spaces 2020-01-16 16:36:33 -05:00
William Falcon d27ff46920 cleared spaces 2020-01-16 16:33:58 -05:00
William Falcon b4bf33852c cleared spaces 2020-01-16 16:25:25 -05:00
William Falcon 0c38bd6fc2 cleared spaces 2020-01-16 16:23:33 -05:00
William Falcon a23e8bd0ae cleared spaces 2020-01-16 16:23:08 -05:00
William Falcon 0513808fef cleared spaces 2020-01-16 16:20:03 -05:00
William Falcon 16c92eaa56 cleared spaces 2020-01-16 16:08:03 -05:00
William Falcon 891b2c075d cleared spaces 2020-01-16 15:36:40 -05:00
William Falcon f1024a63e5 cleared spaces 2020-01-16 15:12:09 -05:00
William Falcon 6b86754bbf cleared spaces 2020-01-16 15:11:17 -05:00
William Falcon 36da61eb01 fixed lightning import 2020-01-16 14:51:54 -05:00
William Falcon 6a414195fd working on trainer docs 2020-01-16 13:36:48 -05:00
William Falcon f353b021b5 working on trainer docs 2020-01-16 10:51:15 -05:00
William Falcon d05f805b25 working on trainer docs 2020-01-16 10:47:39 -05:00
William Falcon 1c7a220432 working on trainer docs 2020-01-16 10:47:12 -05:00
William Falcon ed91ad6407 working on trainer docs 2020-01-16 10:41:05 -05:00
William Falcon 62d213ab3c working on trainer docs 2020-01-16 10:40:16 -05:00
William Falcon 19e13e776b working on trainer docs 2020-01-16 10:33:19 -05:00
William Falcon 59e22a9225 working on trainer docs 2020-01-16 10:32:41 -05:00
William Falcon cebcd3039c set auto dp if no backend 2020-01-16 10:25:51 -05:00
William Falcon 0b0f2c01e1 working on trainer docs 2020-01-16 10:16:17 -05:00
William Falcon 1b12cb83dc working on trainer docs 2020-01-16 10:14:29 -05:00
William Falcon 80454d3635 working on trainer docs 2020-01-16 10:13:48 -05:00
William Falcon 8883f031ac working on trainer docs 2020-01-16 09:55:55 -05:00
William Falcon 87d9c21eb7 working on trainer docs 2020-01-16 09:50:13 -05:00
William Falcon 365558c824 working on trainer docs 2020-01-16 09:26:35 -05:00
William Falcon f700912f72 making private members 2020-01-16 08:26:53 -05:00
William Falcon f80d24c188 making private members 2020-01-16 08:11:04 -05:00
William Falcon 145ea2713d making private members 2020-01-16 08:06:12 -05:00
William Falcon d247431300 finished rebase 2020-01-16 07:45:36 -05:00
William Falcon a67d471919 finished rebase 2020-01-16 07:27:56 -05:00
William Falcon 3e5c5f9588 added direct links to docs 2020-01-16 07:27:31 -05:00
William Falcon 637f2344de added direct links to docs 2020-01-16 07:27:31 -05:00
William Falcon 5a1ca83570 added direct links to docs 2020-01-16 07:27:22 -05:00
William Falcon 31a3854e6a added direct links to docs 2020-01-16 07:27:22 -05:00
William Falcon d34de3890e added direct links to docs 2020-01-16 07:27:22 -05:00
William Falcon 4b08974d4d added direct links to docs 2020-01-16 07:27:02 -05:00
William Falcon d45f091a91 added callbacks to menu 2020-01-16 07:27:02 -05:00
William Falcon f9285787a1 fixed left menu 2020-01-16 07:27:02 -05:00
William Falcon c6c67a34ad finished callbacks 2020-01-16 07:27:02 -05:00
William Falcon 24897506a0 finished callbacks 2020-01-16 07:26:45 -05:00
William Falcon 891991e77e finished callbacks 2020-01-16 07:25:31 -05:00
William Falcon 0b416e96b0 updated docs 2020-01-16 07:25:31 -05:00
William Falcon b844e28457 updated links in ninja file 2020-01-16 07:25:31 -05:00
William Falcon a3e47e74f5 updated gitignore 2020-01-16 07:25:31 -05:00
William Falcon 9f9bf65ede added direct links to docs 2020-01-16 07:25:16 -05:00
William Falcon 610edf8c3e added direct links to docs 2020-01-16 06:04:17 -05:00
William Falcon 937978f0d3 added direct links to docs 2020-01-15 22:01:11 -05:00
William Falcon d71342cb61 added direct links to docs 2020-01-15 21:49:12 -05:00
William Falcon 9bccb4ccdd added direct links to docs 2020-01-15 21:43:04 -05:00
William Falcon 2f12f21f34 added direct links to docs 2020-01-15 21:36:43 -05:00
William Falcon 88c84dccb0 added callbacks to menu 2020-01-15 21:29:30 -05:00
William Falcon da721527a8 fixed left menu 2020-01-15 21:17:16 -05:00
William Falcon 519f70edf0 finished callbacks 2020-01-15 20:57:04 -05:00
William Falcon 592e087df1 finished callbacks 2020-01-15 20:50:46 -05:00
William Falcon 7003f74751 finished callbacks 2020-01-15 20:36:57 -05:00
William Falcon f3d517deb5 updated docs 2020-01-15 19:44:02 -05:00
William Falcon 8efaba1591 updated links in ninja file 2020-01-15 18:35:01 -05:00
William Falcon b15fe62246 Merge branch 'clean_docs' of https://github.com/williamFalcon/pytorch-lightning into clean_docs 2020-01-15 15:19:41 -05:00
William Falcon 2916a05f72 updated gitignore 2020-01-15 15:19:36 -05:00
William Falcon ee20b83349 updated gitignore 2020-01-15 15:12:54 -05:00
15 changed files with 120 additions and 21 deletions
+3
View File
@@ -6,6 +6,7 @@ app/models/
pip-wheel-metadata/ pip-wheel-metadata/
lightning_logs/ lightning_logs/
# Test-tube # Test-tube
test_tube_logs/ test_tube_logs/
test_tube_data/ test_tube_data/
@@ -14,6 +15,7 @@ test_tube_exp/
# Documentations # Documentations
docs/source/pl_examples*.rst docs/source/pl_examples*.rst
docs/source/pytorch_lightning*.rst docs/source/pytorch_lightning*.rst
tests/tests/
/docs/source/*.md /docs/source/*.md
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
@@ -22,6 +24,7 @@ __pycache__/
*$py.class *$py.class
timit_data/ timit_data/
# C extensions # C extensions
*.so *.so
+14
View File
@@ -0,0 +1,14 @@
.. role:: hidden
:class: hidden-section
Callbacks
===========
.. automodule:: pytorch_lightning.callbacks
:exclude-members:
_del_model,
_save_model,
on_epoch_end,
on_train_end,
on_epoch_begin,
check_monitor_top_k,
on_train_begin,
+21
View File
@@ -0,0 +1,21 @@
Multi-gpu (same node) training
==============================
Multi-node training
====================
16-bit precision
=================
gradient clipping
=================
modifying training via hooks
=============================
.. toctree::
:maxdepth: 3
pl_examples
+1 -3
View File
@@ -44,22 +44,20 @@ PyTorch-Lightning Documentation
common-cases common-cases
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
:name: community :name: community
:caption: Community :caption: Community
CODE_OF_CONDUCT.md CODE_OF_CONDUCT.md
CONTRIBUTING.md CONTRIBUTING.md
BECOMING_A_CORE_CONTRIBUTOR.md BECOMING_A_CORE_CONTRIBUTOR.md
governance.md governance.md
Indices and tables Indices and tables
------------------ ------------------
* :ref:`genindex` * :ref:`genindex`
* :ref:`modindex` * :ref:`modindex`
* :ref:`search` * :ref:`search`
+10
View File
@@ -0,0 +1,10 @@
.. role:: hidden
:class: hidden-section
LightningModule
===========
.. automodule:: pytorch_lightning.core
:exclude-members:
_abc_impl,
summarize,
+12
View File
@@ -0,0 +1,12 @@
.. role:: hidden
:class: hidden-section
Logging
===========
.. automodule:: pytorch_lightning.logging
:exclude-members:
_abc_impl,
_save_model,
on_epoch_end,
on_train_end,
on_epoch_begin,
+7
View File
@@ -0,0 +1,7 @@
pl_examples
===========
.. toctree::
:maxdepth: 4
pl_examples
+21
View File
@@ -0,0 +1,21 @@
.. role:: hidden
:class: hidden-section
Trainer
===========
.. automodule:: pytorch_lightning.trainer
:members: fit, test
:exclude-members:
run_pretrain_routine,
_abc_impl,
_Trainer__set_root_gpu,
_Trainer__init_optimizers,
_Trainer__parse_gpu_ids,
_Trainer__configure_schedulers,
data_parallel,
num_gpus,
slurm_job_id,
tng_tqdm_dic,
training_tqdm_dict,
init_optimizers,
configure_schedulers
+20
View File
@@ -0,0 +1,20 @@
Refactoring PyTorch into Lightning
==================================
`Tutorial <https://towardsdatascience.com/how-to-refactor-your-pytorch-code-to-get-these-42-benefits-of-pytorch-lighting-6fdd0dc97538>`_
Start a research project
=========================
`Research seed <https://github.com/PytorchLightning/pytorch-lightning-conference-seed>`_
Basic Lightning use
====================
`Tutorial <https://towardsdatascience.com/supercharge-your-ai-research-with-pytorch-lightning-337948a99eec>`_
9 key Lightning tricks
========================
`Tutorial <9 key speed features in Pytorch-Lightning>`_
Multi-node training on SLURM
=============================
`Tutorial <https://towardsdatascience.com/trivial-multi-node-training-with-pytorch-lightning-ff75dfb809bd>`_
+5 -5
View File
@@ -1,15 +1,13 @@
""" """
Callbacks Callbacks
========= ====================================
Callbacks supported by Lightning Callbacks supported by Lightning
""" """
import logging
import os import os
import shutil import shutil
import logging
import warnings import warnings
import numpy as np import numpy as np
from pytorch_lightning.overrides.data_parallel import LightningDistributedDataParallel from pytorch_lightning.overrides.data_parallel import LightningDistributedDataParallel
@@ -165,7 +163,9 @@ class EarlyStopping(Callback):
class ModelCheckpoint(Callback): class ModelCheckpoint(Callback):
r"""Save the model after every epoch. r"""
Save the model after every epoch.
Args: Args:
filepath (str): path to save the model file. filepath (str): path to save the model file.
+3 -6
View File
@@ -5,15 +5,16 @@ import warnings
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from argparse import Namespace from argparse import Namespace
import pandas as pd import pandas as pd
import torch import torch
import torch.distributed as dist import torch.distributed as dist
#
from pytorch_lightning.core.decorators import data_loader from pytorch_lightning.core.decorators import data_loader
from pytorch_lightning.core.grads import GradInformation from pytorch_lightning.core.grads import GradInformation
from pytorch_lightning.core.hooks import ModelHooks from pytorch_lightning.core.hooks import ModelHooks
from pytorch_lightning.core.memory import ModelSummary
from pytorch_lightning.core.saving import ModelIO from pytorch_lightning.core.saving import ModelIO
from pytorch_lightning.core.memory import ModelSummary
from pytorch_lightning.overrides.data_parallel import LightningDistributedDataParallel from pytorch_lightning.overrides.data_parallel import LightningDistributedDataParallel
@@ -679,7 +680,6 @@ class LightningModule(ABC, GradInformation, ModelIO, ModelHooks):
@abstractmethod @abstractmethod
def configure_optimizers(self): def configure_optimizers(self):
r""" r"""
This is where you choose what optimizers and learning-rate schedulers to use in your optimization. This is where you choose what optimizers and learning-rate schedulers to use in your optimization.
Normally you'd need one. But in the case of GANs or something more esoteric you might have multiple. Normally you'd need one. But in the case of GANs or something more esoteric you might have multiple.
@@ -1015,7 +1015,6 @@ class LightningModule(ABC, GradInformation, ModelIO, ModelHooks):
map_location (dict): A dictionary mapping saved weight GPU devices to new map_location (dict): A dictionary mapping saved weight GPU devices to new
GPU devices (example: {'cuda:1':'cuda:0'}) GPU devices (example: {'cuda:1':'cuda:0'})
Return: Return:
LightningModule with loaded weights LightningModule with loaded weights
@@ -1136,7 +1135,6 @@ class LightningModule(ABC, GradInformation, ModelIO, ModelHooks):
def freeze(self): def freeze(self):
r""" r"""
Freeze all params for inference Freeze all params for inference
Example Example
@@ -1168,7 +1166,6 @@ class LightningModule(ABC, GradInformation, ModelIO, ModelHooks):
def on_load_checkpoint(self, checkpoint): def on_load_checkpoint(self, checkpoint):
r""" r"""
Called by lightning to restore your model. Called by lightning to restore your model.
If you saved something with **on_save_checkpoint** this is your chance to restore this. If you saved something with **on_save_checkpoint** this is your chance to restore this.
-1
View File
@@ -71,7 +71,6 @@ Call the logger anywhere from your LightningModule by doing:
Supported Loggers Supported Loggers
----------------- -----------------
""" """
from os import environ from os import environ
from .base import LightningLoggerBase, rank_zero_only from .base import LightningLoggerBase, rank_zero_only
-1
View File
@@ -26,5 +26,4 @@ This is the basic use of the trainer:
""" """
from .trainer import Trainer from .trainer import Trainer
__all__ = ['Trainer'] __all__ = ['Trainer']
+3 -4
View File
@@ -1,9 +1,8 @@
import logging
import os import os
import sys import sys
import warnings import warnings
import logging
import torch import torch
import torch.distributed as dist import torch.distributed as dist
@@ -20,6 +19,7 @@ from pytorch_lightning.trainer.distrib_parts import (
parse_gpu_ids, parse_gpu_ids,
determine_root_gpu_device determine_root_gpu_device
) )
from pytorch_lightning.trainer.evaluation_loop import TrainerEvaluationLoopMixin from pytorch_lightning.trainer.evaluation_loop import TrainerEvaluationLoopMixin
from pytorch_lightning.trainer.logging import TrainerLoggingMixin from pytorch_lightning.trainer.logging import TrainerLoggingMixin
from pytorch_lightning.trainer.model_hooks import TrainerModelHooksMixin from pytorch_lightning.trainer.model_hooks import TrainerModelHooksMixin
@@ -850,7 +850,6 @@ class Trainer(TrainerIOMixin,
# run test from a loaded model # run test from a loaded model
model = LightningModule.load_from_checkpoint('path/to/checkpoint.ckpt') model = LightningModule.load_from_checkpoint('path/to/checkpoint.ckpt')
trainer = Trainer() trainer = Trainer()
trainer.test(model) trainer.test(model)
""" """
self.testing = True self.testing = True
-1
View File
@@ -98,7 +98,6 @@ from abc import ABC
from subprocess import call from subprocess import call
from argparse import Namespace from argparse import Namespace
import pandas as pd
import torch import torch
import torch.distributed as dist import torch.distributed as dist