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
20 changed files with 61 additions and 320 deletions
+1
View File
@@ -16,6 +16,7 @@ test_tube_exp/
docs/source/pl_examples*.rst
docs/source/pytorch_lightning*.rst
tests/tests/
/docs/source/*.md
# Byte-compiled / optimized / DLL files
__pycache__/
+9 -6
View File
@@ -1,6 +1,6 @@
<div align="center">
<img src="docs/source/_static/images/lightning_logo.png" width="50" height="50">
![Logo](docs/source/_static/images/lightning_logo_small.png)
# PyTorch Lightning
@@ -14,10 +14,10 @@
[![Coverage](docs/source/_static/images/coverage.svg)](https://github.com/PytorchLightning/pytorch-lightning/tree/master/tests#running-coverage)
[![CodeFactor](https://www.codefactor.io/repository/github/borda/pytorch-lightning/badge)](https://www.codefactor.io/repository/github/borda/pytorch-lightning)
[![ReadTheDocs](https://readthedocs.org/projects/pytorch-lightning/badge/?version=0.6.0)](https://pytorch-lightning.readthedocs.io/en/0.6.0/)
[![ReadTheDocs](https://readthedocs.org/projects/pytorch-lightning/badge/?version=latest)](https://pytorch-lightning.readthedocs.io/en/latest)
[![Slack](https://img.shields.io/badge/slack-chat-green.svg?logo=slack)](https://join.slack.com/t/pytorch-lightning/shared_invite/enQtODU5ODIyNTUzODQwLTFkMDg5Mzc1MDBmNjEzMDgxOTVmYTdhYjA1MDdmODUyOTg2OGQ1ZWZkYTQzODhhNzdhZDA3YmNhMDhlMDY4YzQ)
[![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/PytorchLightning/pytorch-lightning/blob/master/LICENSE)
[![Next Release](https://img.shields.io/badge/Next%20Release-Mar%2021-<COLOR>.svg)](https://shields.io/)
[![Next Release](https://img.shields.io/badge/Next%20Release-Feb%206-<COLOR>.svg)](https://shields.io/)
<!--
removed until codecov badge isn't empy. likely a config error showing nothing on master.
@@ -32,9 +32,12 @@ pip install pytorch-lightning
```
## Docs
- [master](https://pytorch-lightning.readthedocs.io/en/latest)
- [0.6.0](https://pytorch-lightning.readthedocs.io/en/0.6.0/)
- [0.5.3.2](https://pytorch-lightning.readthedocs.io/en/0.5.3.2/)
[jan 20, 2020]
**[Old docs (some links might be broken)](https://pytorch-lightning.readthedocs.io/en/stable)
###### As a temporary hack, when you get the 404, replace williamfalcon.github.io with pytorchlightning.github.io.
**[New docs, CURRENTLY DEBUGING](https://pytorch-lightning.rtfd.io/en/latest)**
## Demo
+1 -2
View File
@@ -6,5 +6,4 @@ pandoc
docutils
git+https://github.com/PytorchLightning/lightning_sphinx_theme.git
sphinxcontrib-fulltoc
sphinxcontrib-mockautodoc
pip_shims
sphinxcontrib-mockautodoc
@@ -1,59 +0,0 @@
# How to become a core contributor
Thanks for your interest in joining the Lightning team! Were a rapidly growing project which is poised to become the go-to framework for DL researchers!
We're currently recruiting for a team of 5 core maintainers.
As a core maintainer you will have a strong say in the direction of the project. Big changes will require a majority of maintainers to agree.
### Code of conduct
First and foremost, you'll be evaluated against [these core values](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/CONTRIBUTING.md). Any code we commit or feature we add needs to align with those core values.
### The bar for joining the team
Lightning is being used to solve really hard problems at the top AI labs in the world. As such, the bar for adding team members is extremely high. Candidates must have solid engineering skills, have a good eye for user experience, and must be a power user of Lightning and PyTorch.
With that said, the Lightning team will be diverse and a reflection of an inclusive AI community. You don't have to be an engineer to conntribute! Scientists with great usability intuition and PyTorch ninja skills are welcomed!
### Responsibilities:
The responsibilities mainly revolve around 3 things.
#### Github issues
- Here we want to help users have an amazing experience. These range from questions from new people getting into DL to questions from researchers about doing something esoteric with Lightning
Often, these issues require some sort of bug fix, document clarification or new functionality to be scoped out.
- To become a core member you must resolve at least 10 Github issues which align with the API design goals for Lightning. By the end of these 10 issues I should feel comfortable in the way you answer user questions
Pleasant/helpful tone.
- Can abstract from that issue or bug into functionality that might solve other related issues or makes the platform more flexible.
- Dont make users feel like they dont know what theyre doing. Were here to help and to make everyones experience delightful.
#### Pull requests
- Here we need to ensure the code that enters Lightning is high quality. For each PR we need to:
- Make sure code coverage does not decrease
- Documents are updated
- Code is elegant and simple
- Code is NOT overly engineered or hard to read
- Ask yourself, could a non-engineer understand whats happening here?
- Make sure new tests are written
- Is this NECESSARY for Lightning? There are some PRs which are just purely about adding engineering complexity which have no place in Lightning.
Guidance
- Some other PRs are for people who are wanting to get involved and add something unnecessary. We do want their help though! So dont approve the PR, but direct them to a Github issue that they might be interested in helping with instead!
- To be considered for core contributor, please review 10 PRs and help the authors land it on master. Once you've finished the review, ping me
for a sanity check. At the end of 10 PRs if your PR reviews are inline with expectations described above, then you can merge PRs on your own going forward,
otherwise we'll do a few more until we're both comfortable :)
#### Project directions
There are some big decisions which the project must make. For these I expect core contributors to have something meaningful to add if its their area of expertise.
#### Diversity
Lightning should reflect the broader community it serves. As such we should have scientists/researchers from
different fields contributing!
The first 5 core contributors will fit this profile. Thus if you overlap strongly with experiences and expertise as someone else on the team, you might have to wait until the next set of contributors are added.
#### Summary: Requirements to apply
- Solve 10 Github issues. The goal is to be inline with expectations for solving issues by the last one so you can do them on your own. If not, I might ask you to solve a few more specific ones.
- Do 10 PR reviews. The goal is to be inline with expectations for solving issues by the last one so you can do them on your own. If not, I might ask you to solve a few more specific ones.
If you want to be considered, ping me on gitter and start [tracking your progress here](https://docs.google.com/spreadsheets/d/15D58gp8DvI0Z6qbbYVRuaWioiwzafcP58-UlbuO_CMU/edit?usp=sharing).
-76
View File
@@ -1,76 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at waf2107@columbia.edu. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
-53
View File
@@ -1,53 +0,0 @@
# Contributing
Welcome to the PyTorch Lightning community! We're building the most advanced research platform on the planet to implement the latest, best practices that the amazing PyTorch team rolls out!
## Main Core Value: One less thing to remember
Simplify the API as much as possible from the user perspective. Any additions or improvements should minimize things the user needs to remember.
For example: One benefit of the validation_step is that the user doesn't have to remember to set the model to .eval(). This avoids all sorts of subtle errors the user could make.
## Lightning Design Principles
We encourage all sorts of contributions you're interested in adding! When coding for lightning, please follow these principles.
#### No PyTorch Interference
We don't want to add any abstractions on top of pure PyTorch. This gives researchers all the control they need without having to learn yet another framework.
#### Simple Internal Code
It's useful for users to look at the code and understand very quickly what's happening. Many users won't be engineers. Thus we need to value clear, simple code over condensed ninja moves. While that's super cool, this isn't the project for that :)
#### Force User Decisions To Best Practices
There are 1,000 ways to do something. However, something eventually becomes standard practice that everyone does. Thus we pick one way of doing it and force everyone to do it this way. A good example is accumulated gradients. There are many ways to implement, we just pick one and force users to use that one. A bad forced decision would be to make users use a specific library to do something.
When something becomes a best practice, we add it to the framework. This likely looks like code in utils or in the model file that everyone keeps adding over and over again across projects. When this happens, bring that code inside the trainer and add a flag for it.
#### Simple External API
What makes sense to you may not make sense to others. Create an issue with an API change suggestion and validate that it makes sense for others. Treat code changes how you treat a startup: validate that it's a needed feature, then add if it makes sense for many people.
#### Backward-compatible API
We all hate updating our deep learning packages because we don't want to refactor a bunch of stuff. In Lightning, we make sure every change we make which could break an API is backwards compatible with good deprecation warnings.
You shouldn't be afraid to upgrade Lightning :)
#### Gain User Trust
As a researcher you can't have any part of your code going wrong. So, make thorough tests that ensure an implementation of a new trick or subbtle change is correct.
#### Interoperability
Have a favorite feature from other libraries like fast.ai or transformers? Those should just work with lightning as well. Grab your favorite model or learning rate scheduler from your favorite library and run it in Lightning.
## Contribution Types
Currently looking for help implementing new features or adding bug fixes.
A lot of good work has already been done in project mechanics (requirements.txt, setup.py, pep8, badges, ci, etc...) we're in a good state there thanks to all the early contributors (even pre-beta release)!
## Bug Fixes:
1. Submit a github issue.
2. Fix it.
3. Submit a PR!
## New Features:
1. Submit a github issue.
2. We'll agree on the feature scope.
3. Submit a PR! (with updated docs and tests 🙃).
## Coding Styleguide
1. Test the code with flake8.
2. Use f-strings.
-16
View File
@@ -1,16 +0,0 @@
# Before submitting
- [ ] Was this discussed/approved via a Github issue? (no need for typos, doc improvements)
- [ ] Did you read the [contributor guideline](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/CONTRIBUTING.md)?
- [ ] Did you make sure to update the docs?
- [ ] Did you write any new necessary tests?
## What does this PR do?
Fixes # (issue).
## PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
## Did you have fun?
Make sure you had fun coding 🙃
@@ -2,7 +2,6 @@
'github': 'https://github.com/PytorchLightning/pytorch-lightning',
'github_issues': 'https://github.com/PytorchLightning/pytorch-lightning/issues',
'contributing': 'https://github.com/PytorchLightning/pytorch-lightning/blob/master/CONTRIBUTING.md',
'governance': 'https://github.com/PytorchLightning/pytorch-lightning/blob/master/governance.md',
'docs': 'https://pytorch-lightning.rtfd.io/en/latest',
'twitter': 'https://twitter.com/PyTorchLightnin',
'discuss': 'https://discuss.pytorch.org',
-8
View File
@@ -1,8 +0,0 @@
# Pytorch Lightning Governance | Persons of interest
### Maintainers
- William Falcon ([williamFalcon](https://github.com/williamFalcon))
- Jirka Borovek ([Borda](https://github.com/Borda))
- Nick Eggert ([neggert](https://github.com/neggert))
- Jeff Ling ([jeffling](https://github.com/jeffling))
- Tullie Murrell ([tullie](https://github.com/tullie))
@@ -34,12 +34,9 @@ class ImageNetLightningModel(pl.LightningModule):
self.hparams = hparams
self.model = models.__dict__[self.hparams.arch](pretrained=self.hparams.pretrained)
def forward(self, x):
return self.model(x)
def training_step(self, batch, batch_idx):
images, target = batch
output = self.forward(images)
output = self.model(images)
loss_val = F.cross_entropy(output, target)
acc1, acc5 = self.__accuracy(output, target, topk=(1, 5))
@@ -62,7 +59,7 @@ class ImageNetLightningModel(pl.LightningModule):
def validation_step(self, batch, batch_idx):
images, target = batch
output = self.forward(images)
output = self.model(images)
loss_val = F.cross_entropy(output, target)
acc1, acc5 = self.__accuracy(output, target, topk=(1, 5))
@@ -135,7 +132,7 @@ class ImageNetLightningModel(pl.LightningModule):
std=[0.229, 0.224, 0.225],
)
train_dir = os.path.join(self.hparams.data_path, 'train')
train_dir = os.path.join(self.hparams.data, 'train')
train_dataset = datasets.ImageFolder(
train_dir,
transforms.Compose([
@@ -165,7 +162,7 @@ class ImageNetLightningModel(pl.LightningModule):
mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225],
)
val_dir = os.path.join(self.hparams.data_path, 'val')
val_dir = os.path.join(self.hparams.data, 'val')
val_loader = torch.utils.data.DataLoader(
datasets.ImageFolder(val_dir, transforms.Compose([
transforms.Resize(256),
@@ -188,7 +185,7 @@ class ImageNetLightningModel(pl.LightningModule):
' (default: resnet18)')
parser.add_argument('--epochs', default=90, type=int, metavar='N',
help='number of total epochs to run')
parser.add_argument('--seed', type=int, default=42,
parser.add_argument('--seed', type=int, default=None,
help='seed for initializing training. ')
parser.add_argument('-b', '--batch-size', default=256, type=int,
metavar='N',
@@ -217,7 +214,7 @@ def get_args():
help='how many gpus')
parent_parser.add_argument('--distributed-backend', type=str, default='dp', choices=('dp', 'ddp', 'ddp2'),
help='supports three options dp, ddp, ddp2')
parent_parser.add_argument('--use-16bit', dest='use_16bit', action='store_true',
parent_parser.add_argument('--use-16bit', dest='use-16bit', action='store_true',
help='if true uses 16 bit precision')
parent_parser.add_argument('-e', '--evaluate', dest='evaluate', action='store_true',
help='evaluate model on validation set')
+15 -30
View File
@@ -71,23 +71,21 @@ class EarlyStopping(Callback):
Stop training when a monitored quantity has stopped improving.
Args:
monitor (str): quantity to be monitored. Default: ``'val_loss'``.
monitor (str): quantity to be monitored.
min_delta (float): minimum change in the monitored quantity
to qualify as an improvement, i.e. an absolute
change of less than `min_delta`, will count as no
improvement. Default: ``0``.
change of less than min_delta, will count as no
improvement.
patience (int): number of epochs with no improvement
after which training will be stopped. Default: ``0``.
verbose (bool): verbosity mode. Default: ``0``.
after which training will be stopped.
verbose (bool): verbosity mode.
mode (str): one of {auto, min, max}. In `min` mode,
training will stop when the quantity
monitored has stopped decreasing; in `max`
mode it will stop when the quantity
monitored has stopped increasing; in `auto`
mode, the direction is automatically inferred
from the name of the monitored quantity. Default: ``'auto'``.
strict (bool): whether to crash the training if `monitor` is
not found in the metrics. Default: ``True``.
from the name of the monitored quantity.
Example::
@@ -99,20 +97,18 @@ class EarlyStopping(Callback):
"""
def __init__(self, monitor='val_loss',
min_delta=0.0, patience=0, verbose=0, mode='auto', strict=True):
min_delta=0.0, patience=0, verbose=0, mode='auto'):
super(EarlyStopping, self).__init__()
self.monitor = monitor
self.patience = patience
self.verbose = verbose
self.strict = strict
self.min_delta = min_delta
self.wait = 0
self.stopped_epoch = 0
if mode not in ['auto', 'min', 'max']:
if self.verbose > 0:
logging.info(f'EarlyStopping mode {mode} is unknown, fallback to auto mode.')
logging.info(f'EarlyStopping mode {mode} is unknown, fallback to auto mode.')
mode = 'auto'
if mode == 'min':
@@ -132,22 +128,6 @@ class EarlyStopping(Callback):
self.on_train_begin()
def check_metrics(self, logs):
monitor_val = logs.get(self.monitor)
error_msg = (f'Early stopping conditioned on metric `{self.monitor}`'
f' which is not available. Available metrics are:'
f' `{"`, `".join(list(logs.keys()))}`')
if monitor_val is None:
if self.strict:
raise RuntimeError(error_msg)
elif self.verbose > 0:
warnings.warn(error_msg, RuntimeWarning)
return False
return True
def on_train_begin(self, logs=None):
# Allow instances to be re-used
self.wait = 0
@@ -155,11 +135,16 @@ class EarlyStopping(Callback):
self.best = np.Inf if self.monitor_op == np.less else -np.Inf
def on_epoch_end(self, epoch, logs=None):
current = logs.get(self.monitor)
stop_training = False
if not self.check_metrics(logs):
if current is None:
warnings.warn(
f'Early stopping conditioned on metric `{self.monitor}`'
f' which is not available. Available metrics are: {",".join(list(logs.keys()))}',
RuntimeWarning)
stop_training = True
return stop_training
current = logs.get(self.monitor)
if self.monitor_op(current - self.min_delta, self.best):
self.best = current
self.wait = 0
+1 -2
View File
@@ -124,13 +124,12 @@ class ModelHooks(torch.nn.Module):
"""
pass
def backward(self, use_amp, loss, optimizer, optimizer_idx):
def backward(self, use_amp, loss, optimizer):
"""Override backward with your own implementation if you need to
:param use_amp: Whether amp was requested or not
:param loss: Loss is already scaled by accumulated grads
:param optimizer: Current optimizer being used
:param optimizer_idx: Index of the current optimizer being used
:return:
Called to perform backward step.
+9 -7
View File
@@ -76,39 +76,41 @@ from os import environ
from .base import LightningLoggerBase, rank_zero_only
from .tensorboard import TensorBoardLogger
loggers = ['TensorBoardLogger']
all = []
try:
# needed to prevent ImportError and duplicated logs.
environ["COMET_DISABLE_AUTO_LOGGING"] = "1"
from .comet import CometLogger
loggers.append('CometLogger')
all.append('CometLogger')
except ImportError:
del environ["COMET_DISABLE_AUTO_LOGGING"]
try:
from .mlflow import MLFlowLogger
loggers.append('MLFlowLogger')
all.append('MLFlowLogger')
except ImportError:
pass
try:
from .neptune import NeptuneLogger
loggers.append('NeptuneLogger')
all.append('NeptuneLogger')
except ImportError:
pass
all.append('TensorBoardLogger')
try:
from .test_tube import TestTubeLogger
loggers.append('TestTubeLogger')
all.append('TestTubeLogger')
except ImportError:
pass
try:
from .wandb import WandbLogger
loggers.append('WandbLogger')
all.append('WandbLogger')
except ImportError:
pass
__all__ = loggers
__all__ = all
+1 -2
View File
@@ -8,5 +8,4 @@ warnings.warn("`root_module` package has been renamed to `core` since v0.6.0"
" and will be removed in v0.8.0", DeprecationWarning)
from pytorch_lightning.core import ( # noqa: E402
decorators, grads, hooks, root_module, memory, model_saving
)
decorators, grads, hooks, root_module, memory, model_saving)
@@ -55,20 +55,10 @@ class TrainerCallbackConfigMixin(ABC):
self.early_stop_callback = EarlyStopping(
monitor='val_loss',
patience=3,
strict=True,
verbose=True,
mode='min'
)
self.enable_early_stop = True
elif early_stop_callback is None:
self.early_stop_callback = EarlyStopping(
monitor='val_loss',
patience=3,
strict=False,
verbose=False,
mode='min'
)
self.enable_early_stop = True
elif not early_stop_callback:
self.early_stop_callback = None
self.enable_early_stop = False
+4 -4
View File
@@ -127,7 +127,7 @@ import sys
from abc import ABC, abstractmethod
import torch
from tqdm.auto import tqdm
import tqdm
from pytorch_lightning.utilities.debugging import MisconfigurationException
@@ -293,9 +293,9 @@ class TrainerEvaluationLoopMixin(ABC):
# main progress bar will already be closed when testing so initial position is free
position = 2 * self.process_position + (not test)
desc = 'Testing' if test else 'Validating'
pbar = tqdm(desc=desc, total=max_batches, leave=test, position=position,
disable=not self.show_progress_bar, dynamic_ncols=True,
unit='batch', file=sys.stdout)
pbar = tqdm.tqdm(desc=desc, total=max_batches, leave=test, position=position,
disable=not self.show_progress_bar, dynamic_ncols=True,
unit='batch', file=sys.stdout)
setattr(self, f'{"test" if test else "val"}_progress_bar', pbar)
# run evaluation
+10 -22
View File
@@ -7,7 +7,7 @@ import logging
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
from tqdm.auto import tqdm
import tqdm
from torch.optim.optimizer import Optimizer
from pytorch_lightning.trainer.auto_mix_precision import TrainerAMPMixin
@@ -52,7 +52,7 @@ class Trainer(TrainerIOMixin,
self,
logger=True,
checkpoint_callback=True,
early_stop_callback=None,
early_stop_callback=True,
default_save_path=None,
gradient_clip_val=0,
gradient_clip=None, # backward compatible, todo: remove in v0.8.0
@@ -121,13 +121,7 @@ class Trainer(TrainerIOMixin,
)
trainer = Trainer(checkpoint_callback=checkpoint_callback)
early_stop_callback (:class:`.EarlyStopping`): Callback for early stopping. If
set to ``True``, then the default callback monitoring ``'val_loss'`` is created.
Will raise an error if ``'val_loss'`` is not found.
If set to ``False``, then early stopping will be disabled.
If set to ``None``, then the default callback monitoring ``'val_loss'`` is created.
If ``'val_loss'`` is not found will work as if early stopping is disabled.
Default: ``None``.
early_stop_callback (:class:`.EarlyStopping`): Callback for early stopping
Example::
from pytorch_lightning.callbacks import EarlyStopping
@@ -135,8 +129,7 @@ class Trainer(TrainerIOMixin,
early_stop_callback = EarlyStopping(
monitor='val_loss',
patience=3,
strict=False,
verbose=False,
verbose=True,
mode='min'
)
@@ -808,29 +801,24 @@ class Trainer(TrainerIOMixin,
ref_model.on_train_start()
if not self.disable_validation and self.num_sanity_val_steps > 0:
# init progress bars for validation sanity check
pbar = tqdm(desc='Validation sanity check',
pbar = tqdm.tqdm(desc='Validation sanity check',
total=self.num_sanity_val_steps * len(self.get_val_dataloaders()),
leave=False, position=2 * self.process_position,
disable=not self.show_progress_bar, dynamic_ncols=True, unit='batch')
self.main_progress_bar = pbar
# dummy validation progress bar
self.val_progress_bar = tqdm(disable=True)
self.val_progress_bar = tqdm.tqdm(disable=True)
eval_results = self.evaluate(model, self.get_val_dataloaders(),
self.num_sanity_val_steps, False)
_, _, _, callback_metrics, _ = self.process_output(eval_results)
self.evaluate(model, self.get_val_dataloaders(), self.num_sanity_val_steps, self.testing)
# close progress bars
self.main_progress_bar.close()
self.val_progress_bar.close()
if self.enable_early_stop:
self.early_stop_callback.check_metrics(callback_metrics)
# init progress bar
pbar = tqdm(leave=True, position=2 * self.process_position,
disable=not self.show_progress_bar, dynamic_ncols=True, unit='batch',
file=sys.stdout)
pbar = tqdm.tqdm(leave=True, position=2 * self.process_position,
disable=not self.show_progress_bar, dynamic_ncols=True, unit='batch',
file=sys.stdout)
self.main_progress_bar = pbar
# clear cache before training
+2 -9
View File
@@ -296,7 +296,6 @@ class TrainerTrainLoopMixin(ABC):
self.current_epoch = epoch
total_val_batches = 0
is_val_epoch = False
if not self.disable_validation:
# val can be checked multiple times in epoch
is_val_epoch = (self.current_epoch + 1) % self.check_val_every_n_epoch == 0
@@ -347,15 +346,13 @@ class TrainerTrainLoopMixin(ABC):
# early stopping
met_min_epochs = epoch >= self.min_epochs - 1
if (self.enable_early_stop and not self.disable_validation and is_val_epoch and
(met_min_epochs or self.fast_dev_run)):
if self.enable_early_stop and (met_min_epochs or self.fast_dev_run):
should_stop = self.early_stop_callback.on_epoch_end(epoch=epoch,
logs=self.callback_metrics)
# stop training
stop = should_stop and met_min_epochs
if stop:
self.main_progress_bar.close()
model.on_train_end()
return
self.main_progress_bar.close()
@@ -403,9 +400,6 @@ class TrainerTrainLoopMixin(ABC):
if self.fast_dev_run or should_check_val:
self.run_evaluation(test=self.testing)
if self.enable_early_stop:
self.early_stop_callback.check_metrics(self.callback_metrics)
# when logs should be saved
should_save_log = (batch_idx + 1) % self.log_save_interval == 0 or early_stop_epoch
if should_save_log or self.fast_dev_run:
@@ -491,14 +485,13 @@ class TrainerTrainLoopMixin(ABC):
# backward pass
model_ref = self.get_model()
model_ref.backward(self.use_amp, closure_loss, optimizer, opt_idx)
model_ref.backward(self.use_amp, closure_loss, optimizer)
# track metrics for callbacks
all_callback_metrics.append(callback_metrics)
# track progress bar metrics
self.add_tqdm_metrics(progress_bar_metrics)
self.add_tqdm_metrics(progress_bar_metrics)
all_log_metrics.append(log_metrics)
# insert after step hook
+1 -3
View File
@@ -140,8 +140,7 @@ def test_running_test_without_val(tmpdir):
val_percent_check=0.2,
test_percent_check=0.2,
checkpoint_callback=checkpoint,
logger=logger,
early_stop_callback=False
logger=logger
)
# fit model
@@ -319,7 +318,6 @@ def test_tbptt_cpu_model(tmpdir):
truncated_bptt_steps=truncated_bptt_steps,
val_percent_check=0,
weights_summary=None,
early_stop_callback=False
)
hparams = tutils.get_hparams()
+1 -1
View File
@@ -392,7 +392,7 @@ def test_multiple_test_dataloader(tmpdir):
default_save_path=tmpdir,
max_epochs=1,
val_percent_check=0.1,
train_percent_check=0.2
train_percent_check=0.2,
)
# fit model