Compare commits

...
11 Commits
Author SHA1 Message Date
William Falcon 00e851958c release v0.3.6.7 2019-08-01 10:26:53 -04:00
William Falcon a0483eec96 fix broken opt link 2019-08-01 10:21:20 -04:00
William Falcon 5e4728b2a7 only proc 0 can submit a continuation slurm job 2019-08-01 10:15:28 -04:00
William Falcon 93ddf555dd :q
erge branch 'master' of https://github.com/williamFalcon/pytorch-lightning
2019-08-01 10:11:35 -04:00
William Falcon 598e1accb5 updated docs 2019-08-01 10:11:26 -04:00
William Falcon a4a8bae359 Update README.md 2019-08-01 10:02:12 -04:00
William Falcon 7b774beb0c release v0.3.6.6 2019-07-28 12:12:45 -04:00
William Falcon 3ffeba4caa Merge pull request #24 from williamFalcon/keys
Keys
2019-07-28 12:11:49 -04:00
William Falcon 6bb3c0306a updated output of test models 2019-07-28 11:51:32 -04:00
William Falcon d372f9a2e2 updated dict keys 2019-07-28 11:46:26 -04:00
William Falcon f1f7698ce1 updated doc indexes 2019-07-28 10:00:53 -04:00
12 changed files with 29 additions and 26 deletions
+4 -4
View File
@@ -4,10 +4,10 @@
</a> </a>
</p> </p>
<h3 align="center"> <h3 align="center">
Pytorch Lightning PyTorch Lightning
</h3> </h3>
<p align="center"> <p align="center">
The Keras for ML researchers using PyTorch. More control. Less boilerplate. The PyTorch Keras for ML researchers. More control. Less boilerplate.
</p> </p>
<p align="center"> <p align="center">
@@ -280,8 +280,8 @@ tensorboard --logdir /some/path
- [Force disable early stop](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#force-disable-early-stop) - [Force disable early stop](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#force-disable-early-stop)
- [Gradient Clipping](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#gradient-clipping) - [Gradient Clipping](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#gradient-clipping)
- [Hooks](https://williamfalcon.github.io/pytorch-lightning/Trainer/hooks/) - [Hooks](https://williamfalcon.github.io/pytorch-lightning/Trainer/hooks/)
- [Learning rate scheduling](https://williamfalcon.github.io/pytorch-lightning/Pytorch-Lightning/LightningModule/#configure_optimizers) - [Learning rate scheduling](https://williamfalcon.github.io/pytorch-lightning/LightningModule/RequiredTrainerInterface/#configure_optimizers)
- [Use multiple optimizers (like GANs)](https://williamfalcon.github.io/pytorch-lightning/Pytorch-Lightning/LightningModule/#configure_optimizers) - [Use multiple optimizers (like GANs)](https://williamfalcon.github.io/pytorch-lightning/LightningModule/RequiredTrainerInterface/#configure_optimizers)
- [Set how much of the training set to check (1-100%)](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#set-how-much-of-the-training-set-to-check) - [Set how much of the training set to check (1-100%)](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#set-how-much-of-the-training-set-to-check)
###### Validation loop ###### Validation loop
@@ -300,7 +300,7 @@ def tng_dataloader(self)
Called by lightning during training loop. Make sure to use the @ptl.data_loader decorator, this ensures not calling this function until the data are needed. Called by lightning during training loop. Make sure to use the @ptl.data_loader decorator, this ensures not calling this function until the data are needed.
##### Return ##### Return
Pytorch DataLoader PyTorch DataLoader
**Example** **Example**
@@ -327,7 +327,7 @@ def tng_dataloader(self)
Called by lightning during validation loop. Make sure to use the @ptl.data_loader decorator, this ensures not calling this function until the data are needed. Called by lightning during validation loop. Make sure to use the @ptl.data_loader decorator, this ensures not calling this function until the data are needed.
##### Return ##### Return
Pytorch DataLoader PyTorch DataLoader
**Example** **Example**
@@ -355,7 +355,7 @@ def test_dataloader(self)
Called by lightning during test loop. Make sure to use the @ptl.data_loader decorator, this ensures not calling this function until the data are needed. Called by lightning during test loop. Make sure to use the @ptl.data_loader decorator, this ensures not calling this function until the data are needed.
##### Return ##### Return
Pytorch DataLoader PyTorch DataLoader
**Example** **Example**
+1 -1
View File
@@ -31,7 +31,7 @@ y_hat = pretrained_model(x)
| Param | description | | Param | description |
|---|---| |---|---|
| weights_path | Path to a pytorch checkpoint | | weights_path | Path to a PyTorch checkpoint |
| tags_csv | Path to meta_tags.csv file generated by the test-tube Experiment | | tags_csv | Path to meta_tags.csv file generated by the test-tube Experiment |
| on_gpu | if True, puts model on GPU. Make sure to use transforms option if model devices have changed | | on_gpu | if True, puts model on GPU. Make sure to use transforms option if model devices have changed |
| map_location | A dictionary mapping saved weight GPU devices to new GPU devices | | map_location | A dictionary mapping saved weight GPU devices to new GPU devices |
+1 -1
View File
@@ -52,7 +52,7 @@ Trainer(experiment=exp)
--- ---
### Tensorboard support ### Tensorboard support
The experiment object is a strict subclass of Pytorch SummaryWriter. However, this class The experiment object is a strict subclass of PyTorch SummaryWriter. However, this class
also snapshots every detail about the experiment (data folder paths, code, hyperparams), also snapshots every detail about the experiment (data folder paths, code, hyperparams),
and allows you to visualize it using tensorboard. and allows you to visualize it using tensorboard.
``` {.python} ``` {.python}
+1 -1
View File
@@ -5,7 +5,7 @@ There are cases when you might want to do something different at different parts
To enable a hook, simply override the method in your LightningModule and the trainer will call it at the correct time. To enable a hook, simply override the method in your LightningModule and the trainer will call it at the correct time.
**Contributing** If there's a hook you'd like to add, simply: **Contributing** If there's a hook you'd like to add, simply:
1. Fork PytorchLightning. 1. Fork PyTorchLightning.
2. Add the hook [here](https://github.com/williamFalcon/pytorch-lightning/blob/master/pytorch_lightning/root_module/hooks.py). 2. Add the hook [here](https://github.com/williamFalcon/pytorch-lightning/blob/master/pytorch_lightning/root_module/hooks.py).
3. Add the correct place in the [Trainer](https://github.com/williamFalcon/pytorch-lightning/blob/master/pytorch_lightning/models/trainer.py) where it should be called. 3. Add the correct place in the [Trainer](https://github.com/williamFalcon/pytorch-lightning/blob/master/pytorch_lightning/models/trainer.py) where it should be called.
+2 -2
View File
@@ -63,8 +63,8 @@ But of course the fun is in all the advanced things it can do:
- [Force disable early stop](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#force-disable-early-stop) - [Force disable early stop](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#force-disable-early-stop)
- [Gradient Clipping](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#gradient-clipping) - [Gradient Clipping](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#gradient-clipping)
- [Hooks](hooks) - [Hooks](hooks)
- [Learning rate scheduling](https://williamfalcon.github.io/pytorch-lightning/Pytorch-Lightning/LightningModule/#configure_optimizers) - [Learning rate scheduling](https://williamfalcon.github.io/pytorch-lightning/LightningModule/RequiredTrainerInterface/#configure_optimizers)
- [Use multiple optimizers (like GANs)](https://williamfalcon.github.io/pytorch-lightning/Pytorch-Lightning/LightningModule/#configure_optimizers) - [Use multiple optimizers (like GANs)](https://williamfalcon.github.io/pytorch-lightning/LightningModule/RequiredTrainerInterface/#configure_optimizers)
- [Set how much of the training set to check (1-100%)](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#set-how-much-of-the-training-set-to-check) - [Set how much of the training set to check (1-100%)](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#set-how-much-of-the-training-set-to-check)
**Validation loop** **Validation loop**
+2 -2
View File
@@ -70,8 +70,8 @@ one could be a seq-2-seq model, both (optionally) ran by the same trainer file.
- [Force disable early stop](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#force-disable-early-stop) - [Force disable early stop](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#force-disable-early-stop)
- [Gradient Clipping](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#gradient-clipping) - [Gradient Clipping](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#gradient-clipping)
- [Hooks](https://williamfalcon.github.io/pytorch-lightning/Trainer/hooks/) - [Hooks](https://williamfalcon.github.io/pytorch-lightning/Trainer/hooks/)
- [Learning rate scheduling](https://williamfalcon.github.io/pytorch-lightning/Pytorch-Lightning/LightningModule/#configure_optimizers) - [Learning rate scheduling](https://williamfalcon.github.io/pytorch-lightning/LightningModule/RequiredTrainerInterface/#configure_optimizers)
- [Use multiple optimizers (like GANs)](https://williamfalcon.github.io/pytorch-lightning/Pytorch-Lightning/LightningModule/#configure_optimizers) - [Use multiple optimizers (like GANs)](https://williamfalcon.github.io/pytorch-lightning/LightningModule/RequiredTrainerInterface/#configure_optimizers)
- [Set how much of the training set to check (1-100%)](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#set-how-much-of-the-training-set-to-check) - [Set how much of the training set to check (1-100%)](https://williamfalcon.github.io/pytorch-lightning/Trainer/Training%20Loop/#set-how-much-of-the-training-set-to-check)
###### Validation loop ###### Validation loop
+2 -2
View File
@@ -1,10 +1,10 @@
site_name: Pytorch lightning Documentation site_name: PyTorch lightning Documentation
theme: theme:
name: 'material' name: 'material'
docs_dir: docs docs_dir: docs
repo_url: https://github.com/williamFalcon/pytorch-lightning repo_url: https://github.com/williamFalcon/pytorch-lightning
site_dir: 'site' site_dir: 'site'
site_description: 'Documentation for Pytorch LightningModule, the researcher version of keras.' site_description: 'Documentation for PyTorch LightningModule, the researcher version of keras.'
dev_addr: '0.0.0.0:8000' dev_addr: '0.0.0.0:8000'
#google_analytics: ['UA-aasd', 'sitename'] #google_analytics: ['UA-aasd', 'sitename']
+2 -2
View File
@@ -612,7 +612,7 @@ class Trainer(TrainerIO):
# enable cluster checkpointing # enable cluster checkpointing
# also restores training state # also restores training state
if self.cluster is not None: # pragma: no cover if self.cluster is not None and self.proc_rank == 0: # pragma: no cover
self.enable_auto_hpc_walltime_manager() self.enable_auto_hpc_walltime_manager()
# --------------------------- # ---------------------------
@@ -772,7 +772,7 @@ class Trainer(TrainerIO):
output = self.model.training_step(data_batch, batch_nb) output = self.model.training_step(data_batch, batch_nb)
try: try:
model_specific_tqdm_metrics_dic = output['tqdm_metrics'] model_specific_tqdm_metrics_dic = output['prog']
except Exception as e: except Exception as e:
model_specific_tqdm_metrics_dic = {} model_specific_tqdm_metrics_dic = {}
@@ -96,12 +96,15 @@ class LightningTestModel(LightningModule):
if self.trainer.use_dp: if self.trainer.use_dp:
loss_val = loss_val.unsqueeze(0) loss_val = loss_val.unsqueeze(0)
output = OrderedDict({ # alternate possible outputs to test
'loss': loss_val if self.trainer.batch_nb % 1 == 0:
}) output = OrderedDict({
'loss': loss_val,
# can also return just a scalar instead of a dict (return loss_val) 'prog': {'some_val': loss_val * loss_val}
return output })
return output
if self.trainer.batch_nb % 2 == 0:
return loss_val
def validation_step(self, data_batch, batch_i): def validation_step(self, data_batch, batch_i):
""" """
+1 -1
View File
@@ -7,7 +7,7 @@ from setuptools import setup, find_packages
# http://blog.ionelmc.ro/2014/05/25/python-packaging/ # http://blog.ionelmc.ro/2014/05/25/python-packaging/
setup( setup(
name="pytorch-lightning", name="pytorch-lightning",
version='0.3.6.5', version='0.3.6.7',
description="The Keras for ML researchers using PyTorch", description="The Keras for ML researchers using PyTorch",
author="William Falcon", author="William Falcon",
author_email="waf2107@columbia.edu", author_email="waf2107@columbia.edu",
+1 -1
View File
@@ -1,4 +1,4 @@
# Pytorch-Lightning Tests # PyTorch-Lightning Tests
## Running tests ## Running tests
The automatic travis tests ONLY run CPU-based tests. Although these cover most of the use cases, The automatic travis tests ONLY run CPU-based tests. Although these cover most of the use cases,