Commit Graph

1250 Commits

Author SHA1 Message Date
Jirka Borovec f278ac42c8
Revert/Fix: epoch indexing from 1, to be from 0 (#2289)
* Revert "deprecated: epoch indexing from 1 (#2206)"

This reverts commit f94b919b

* chlog

* grad index

* Apply suggestions from code review

* tests

* fix

* test
2020-06-19 23:39:53 -04:00
thschaaf 554fb4754c
Bugfix/_has_len (#2293)
* deal with NotImplementedError raised by torchtext

* deal with NotImplementedError raised by torchtext

* Added tests for dataloader which raise NotImplementedError in __len__()

* Fixed some typos

Co-authored-by: Thomas Schaaf <tschaaf@cs.cmu.edu>
2020-06-19 23:38:15 -04:00
Paweł Biernat 3256fe4e5a
Update progress.py (#2268)
Fixes a minor bug introduced in #2213
2020-06-19 15:47:39 -04:00
Jirka Borovec e0b7fed92e
deprecated Trainer proc_rank (#2269)
* deprecated

* test
2020-06-19 15:46:27 -04:00
William Falcon 8d51279703
[refactor results 1] - refactor backward (#2276)
* move backward

* refactor backward to remove 16 bit from user override

* refactor backward to remove 16 bit from user override

* Update pytorch_lightning/core/hooks.py

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2020-06-19 15:44:44 -04:00
Jirka Borovec 54acc79f31
continue 0.8.x (#2264)
* cleaning

* docs

* docs

* types

* mixins

* mixins

* docs

* typo
2020-06-19 11:00:46 -04:00
William Falcon 2fbc997895
Update __init__.py 2020-06-19 02:43:21 -04:00
William Falcon d5f77c9d1b
Release2 (#2262)
* fix missing arg

* fix missing arg

* fix missing arg

* fix missing arg

* fix missing arg

* fix missing arg

* fix missing arg
2020-06-19 02:38:10 -04:00
William Falcon e8f58b5ed6 Merge branch 'master' of https://github.com/PyTorchLightning/pytorch-lightning 2020-06-19 01:11:29 -04:00
William Falcon 3c8c2e3deb fix missing arg 2020-06-19 01:11:22 -04:00
William Falcon a6f94a6f43
remove tpu barrier (#2260) 2020-06-19 00:57:00 -04:00
William Falcon 81720d9ee5
fallback to hparams str (#2259) 2020-06-19 00:49:40 -04:00
William Falcon 57d5f6e74a
Barrier (#2257)
* remove barriers

* remove barriers

* remove barriers

* remove barriers

* remove barriers

* remove barriers

* remove barriers

* remove barriers

* remove barriers

* remove barriers
2020-06-19 00:42:20 -04:00
William Falcon 6ae9a97b09
remove frame inspection on self.hparams (#2253)
* remove frame inspection on self.hparams

* remove frame inspection on self.hparams

* remove frame inspection on self.hparams

* remove frame inspection on self.hparams

* remove frame inspection on self.hparams

* remove frame inspection on self.hparams
2020-06-18 23:08:25 -04:00
William Falcon b5a2f1ec44
fix setup and on fit calls (#2252) 2020-06-18 21:45:09 -04:00
William Falcon b7fc092bf4
made fx public (#2247)
* made fx public

* made fx public

* made fx public
2020-06-18 20:20:29 -04:00
William Falcon 68a1e52292
added barrier (#2245)
* added barrier

* blank line

* added barrier

* added barrier

* made fx public

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2020-06-18 20:15:02 -04:00
Jirka Borovec 596a5d771f
Docs new section (#2236)
* chlog

* docs

* ver++

* docs

* url

* docs

* readme

* docs ---
2020-06-18 17:54:29 -04:00
Vincent Thibault 4903f9ebd4
Fixed the load_from_checkpoint path detected as URL bug (#2244)
* Fixed the load_from_checkpoint path detected as URL bug

* Fixed the load_from_checkpoint path detected as URL bug

* fixed Caps lock typo

* Added .absolute() to checkpoint path to force hard drive prefix in string
2020-06-18 17:53:51 -04:00
j-dsouza e0b7359555
[metrics] IoU Metric (#2062)
* add iou function

* update stat scores

* add iou class

* add iou tests

* chlog

* Apply suggestions from code review

* tests

* docs

* Apply suggestions from code review

* docs

Co-authored-by: Jirka <jirka@pytorchlightning.ai>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2020-06-18 09:06:31 -04:00
William Falcon 79e1426161
Docs clean-up (#2234)
* update docs

* update docs

* update docs

* update docs

* update docs

* update docs
2020-06-18 08:29:18 -04:00
Jirka Borovec a2d3ee80ad
final cleanup for v0.8.0 (#2181)
* final clean for v0.8.0

* chlog

* chlog

* date

* rename stage

* date

* missing
2020-06-18 07:21:44 -04:00
William Falcon 476911d60c
Pid port + duplicate rank_zero logging (#2231)
* init the port using a seed that matches process id for ddp

* init the port using a seed that matches process id for ddp

* init the port using a seed that matches process id for ddp

* init the port using a seed that matches process id for ddp

* init the port using a seed that matches process id for ddp

* init the port using a seed that matches process id for ddp

* init the port using a seed that matches process id for ddp

Co-authored-by: Zhaofeng Wu <zfw7@cs.washington.edu>
2020-06-18 00:19:06 -04:00
William Falcon 15cf6a86c2
Tpu logging (#2230)
* add tpu view

* add tpu view

* add tpu view

* add tpu view

* add tpu view
2020-06-17 22:45:09 -04:00
William Falcon 9ec940493b
Update __init__.py 2020-06-17 19:51:26 -04:00
William Falcon 34816e9ec4
adds setup+teardown hook (#2229)
* allow regression metrics to import

* allow regression metrics to import

* allow regression metrics to import

* allow regression metrics to import

* allow regression metrics to import

* allow regression metrics to import

* allow regression metrics to import

* allow regression metrics to import

* allow regression metrics to import
2020-06-17 19:49:58 -04:00
William Falcon 1635ba1bb3
allow regression metrics to import (#2225)
* allow regression metrics to import

* allow regression metrics to import

* docs

* Apply suggestions from code review

Co-authored-by: Jirka <jirka@pytorchlightning.ai>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2020-06-17 18:44:29 -04:00
Jirka Borovec a5f7c6368e
fixing docs (#2227) 2020-06-17 17:44:11 -04:00
Xavier Sumba ead874b17d
Regression metrics (#2221)
* add regression metrics

* solve tests

* add docs
2020-06-17 13:44:06 -04:00
William Falcon 2411c3be70
replace train_percent_check with limit_train_batches (#2220)
* drop train_percent_check

* drop train_percent_check

* drop train_percent_check

* drop train_percent_check

* drop train_percent_check

* drop train_percent_check

* drop train_percent_check

* drop train_percent_check

* drop train_percent_check

* drop train_percent_check

* drop train_percent_check

* drop train_percent_check

* drop train_percent_check

* drop train_percent_check

* drop train_percent_check

* drop train_percent_check

* drop train_percent_check

* chlog

* deprecated

* deprecated

* deprecated

* tests

* tests

* Apply suggestions from code review

* tests

* hydra support

* tests

* hydra support

* hydra support

* hydra support

* tests

* typo

* typo

* Update test_dataloaders.py

* docs

* docs

* docs

* docs

Co-authored-by: Jirka <jirka@pytorchlightning.ai>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2020-06-17 13:42:28 -04:00
Nilansh Rajput 25c7465591
Enable gradients at train start (#2200)
* Enable gradients at train start

* Update training_loop.py

Co-authored-by: William Falcon <waf2107@columbia.edu>
2020-06-17 10:52:58 -04:00
William Falcon 2330d32531
hydra ddp support + generalized ddp gpu flags (#2212)
* hydra ddp support

* hydra ddp support

* hydra ddp support

* hydra support

* hydra support

* hydra support
2020-06-17 10:33:25 -04:00
William Falcon 04c794ca72
[WIP] Rename overfit_pct to overfit_batches (and fix) and val_percent_check and test_percent_check (and fix) (#2213)
* fixed percent check for val/test

* fixed percent check for val/test

* fixed percent check for val/test

* fixed percent check for val/test

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* overfit_pct now uses train loaders for val and test and does not shuffle

* add on fit_start on fit_end hooks

* add on fit_start on fit_end hooks

* add on fit_start on fit_end hooks

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2020-06-17 08:03:28 -04:00
William Falcon 97dfd3a80a
Revert "Misleading exception raised during batch scaling (#1973)" (#2219)
This reverts commit f8103f9c7d.
2020-06-17 08:01:53 -04:00
Tejasvi S Tomar f8103f9c7d
Misleading exception raised during batch scaling (#1973)
* Misleading exception raised during batch scaling

Use batch_size from `model.hparams.batch_size` instead of `model.batch_size`

* Improvements considering #1896

* Apply suggestions from code review

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2020-06-17 08:01:04 -04:00
William Falcon e1f238a097
add on fit_start on fit_end hooks (#2217)
* add on fit_start on fit_end hooks

* add on fit_start on fit_end hooks

* add on fit_start on fit_end hooks
2020-06-17 07:37:16 -04:00
Nicki Skafte f1c732a77b
Metric docs fix (#2209)
* fix docs

* Update docs/source/metrics.rst

* Update docs/source/metrics.rst

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

* Update docs/source/metrics.rst

* Update docs/source/metrics.rst

* Update metrics.rst

* title

* fix

* fix for num_classes

* chlog

* nb classes

* hints

* zero division

* add tests

* Update metrics.rst

* Update classification.py

* Update classification.py

* prune doctests

* docs

* Apply suggestions from code review

* Apply suggestions from code review

* flake8

* doctests

* formatting

* cleaning

* formatting

* formatting

* doctests

* flake8

* docs

* rename

* rename

* typo

Co-authored-by: Nicki Skafte <nugginea@gmail.com>
Co-authored-by: William Falcon <waf2107@columbia.edu>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Jirka <jirka@pytorchlightning.ai>
Co-authored-by: edenlightning <66261195+edenlightning@users.noreply.github.com>
2020-06-17 07:34:39 -04:00
William Falcon 022ba5c667
Update __init__.py 2020-06-16 07:52:33 -04:00
William Falcon 55fbcc00f6
Metrics docs (#2184)
* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* Apply suggestions from code review

Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>

* add workers fix

* add workers fix

* add workers fix

* add workers fix

* add workers fix

* add workers fix

* add workers fix

* add workers fix

* add workers fix

* add workers fix

* Update docs/source/metrics.rst

Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>

* Update docs/source/metrics.rst

Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>

* Update docs/source/metrics.rst

Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>

* Update docs/source/metrics.rst

Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>

* add workers fix

* add workers fix

* add workers fix

* doctests

* add workers fix

* add workers fix

* fixes

* fix docs

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* Apply suggestions from code review

Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>

* add workers fix

* Update docs/source/metrics.rst

Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>

* doctests

* add workers fix

* fix docs

* fixes

* fixes

* fix doctests

* Apply suggestions from code review

* fix doctests

* fix examples

* bug

* Update docs/source/metrics.rst

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

* Update docs/source/metrics.rst

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

* Update docs/source/metrics.rst

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

* fixes

* fixes

* fixes

* fixes

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
Co-authored-by: Jirka <jirka@pytorchlightning.ai>
Co-authored-by: Nicki Skafte <nugginea@gmail.com>
2020-06-16 07:42:56 -04:00
Jirka Borovec e289e45120
test: save hparams to yaml (#2198)
* save hparams to yaml

* import

* resolves

* req

* Update requirements/base.txt

Co-authored-by: Omry Yadan <omry@fb.com>

Co-authored-by: Omry Yadan <omry@fb.com>
2020-06-16 06:34:55 -04:00
Jirka Borovec f94b919b96
deprecated: epoch indexing from 1 (#2206)
* epoch indexing from 1

* chlog

* fix tests

* fix tests

* self.min_epochs
2020-06-16 06:33:41 -04:00
Jirka Borovec 8870a84aa8
reduce test warnings (#2202)
* reduce test warnings

* Update test_trainer.py

* Update test_trainer.py

Co-authored-by: William Falcon <waf2107@columbia.edu>
2020-06-15 23:06:17 -04:00
Adrian Wälchli 7dc58bd286
Refactor model summary + generalize example input array (#1773)
* squash

variant a


variant b


add test


revert rename


add changelog


docs


move changelog entry to top


use hooks


wip


wipp


layer summary


clean up, refactor


type hints


rename


remove obsolete code


rename


unused imports


simplify formatting of table and increase readability


doctest


superclass object


update examples


print unknown sizes


more docs and doctest


testing


unknown layers


add rnn test


remove main


restore train mode


test device wip


device


constant


simplify model forward transfer


return summary object in method


extend tests


fix summary for empty module


extend tests


refactor and added hook


variant a


variant b


add test


revert rename


add changelog


docs


move changelog entry to top


remove hardcoded string


simplify


test unknown shapes and all others


comments for tests


fix hparams attribute

* update default

* unused import

* clean up

* replace hardcoded strings

* fix doctest

* fix top/full

* black

* fix rnn test

* fix rnn

* update debugging docs


update docs


typo


update docs


update docs

* add changelog

* extract constant

* setter and getter

* move parity models to test folder

* parameterize mode
2020-06-15 17:05:58 -04:00
Adrian Wälchli 22d9464e56
HenryJia: auto-move data decorator (#1905)
* First attempt at auto-moving data for inference

* Correct my copypaste errors

* Correct for if device is CPU

* Get rid of the WIP code I accidentally added

* Add tests

* Make tests more foolproof

* Make sure we stick with pep8 formatting

* Clarify docs a little

* Apply suggestions from code review

* Get everything working again hopefully

* refactor and added hook


variant a


variant b


add test


revert rename


add changelog


docs

* move changelog entry to top

* Move data transfer to utilities

* Add back in warnings for autotransfer

* Get rid of the test code I ended up accidentally commiting again

* Add docs any changelog

* Correct PR number in Changelog

* Correct changelog

* Update data.py

* Update test_cpu.py

* make a decorator

* type hint

* changelog

* changelog

* remove old function

* import

* test for decorator

* fix test

* remove old test

* doctest

* apply decorator directly

* convert doctest to code block

* prevent side effects in tests

* fix merge

* update forward docs

* update docs

* added docs in section "deployment / prediction"

* update changelog

Co-authored-by: Hengjian Jia <henryjia18@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: William Falcon <waf2107@columbia.edu>
2020-06-15 17:04:32 -04:00
Peter Yu 37e7582486
Add ckpt_path option to LightningModule.test() (#2190)
* Add ckpt_path option to LightningModule.test()

If ckpt_path is "best" (default), it loads the best weights saved by ModelCheckpoint for the test loop.
If ckpt_path is a path to a checkpoint file, it loads the weights from the file for the test loop.
If ckpt_path is None, it uses the weights from the end of training for the test loop.
If model parameter is set, ckpt_path is ignored.

* Update test_set.rst

Co-authored-by: William Falcon <waf2107@columbia.edu>
2020-06-15 08:02:37 -04:00
William Falcon 48a76a785d
Performance docs (#2191)
* add workers fix

* add workers fix
2020-06-15 08:02:19 -04:00
Simon-Martin Schröder fd1693e289
Handle KeyboardInterrupt during training (#2134)
* Handle KeyboardInterrupt during training

Fixes #2079.

* chlog

* Fix whitespace

* Update callback_hook.py

* Update base.py

* Update training_loop.py

* Update test_trainer.py

* Update CHANGELOG.md

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* Update CHANGELOG.md

* on_keyboard_interrupt

Co-authored-by: Jirka <jirka@pytorchlightning.ai>
Co-authored-by: William Falcon <waf2107@columbia.edu>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
2020-06-15 12:35:26 +02:00
William Falcon bd3a1f7dd4
Fast defaults (#2185)
* log row might be a bottleneck depending on network. 50 unblocks this and is small enough for small datasets

* log row might be a bottleneck depending on network. 50 unblocks this and is small enough for small datasets
2020-06-14 20:17:49 -04:00
Nicki Skafte 02262d0a93
Fix for accuracy calculation (#2183)
* accuracy_fix

* fix line length

* Apply suggestions from code review

* Update test_classification.py

Co-authored-by: Nicki Skafte <nugginea@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: William Falcon <waf2107@columbia.edu>
2020-06-14 18:14:29 -04:00
Jirka Borovec c0903b800d
past checkpoints (#2160)
* past checkpoints

* omegaConf save

* enforce type

* resolve=True

Co-authored-by: Omry Yadan <omry@fb.com>

* test omegaconf

* tests

* test past

Co-authored-by: Omry Yadan <omry@fb.com>
2020-06-14 11:36:45 -04:00