Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#see https://github.com/codecov/support/wiki/Codecov-Yaml
codecov:
notify:
require_ci_to_pass: yes

coverage:
precision: 0 # 2 = xx.xx%, 0 = xx%
round: nearest # how coverage is rounded: down/up/nearest
range: 40...100 # custom range of coverage colors from red -> yellow -> green
status:
# https://codecov.readme.io/v1.0/docs/commit-status
project:
default:
against: auto
target: 99% # specify the target coverage for each commit status
threshold: 20% # allow this little decrease on project
# https://github.com/codecov/support/wiki/Filtering-Branches
# branches: master
if_ci_failed: error
# https://github.com/codecov/support/wiki/Patch-Status
patch:
default:
against: auto
target: 40% # specify the target "X%" coverage to hit
# threshold: 50% # allow this much decrease on patch
changes: false

parsers:
gcov:
branch_detection:
conditional: true
loop: true
macro: false
method: false
javascript:
enable_partials: false

comment:
layout: header, diff
require_changes: false
behavior: default # update if exists else create new
# branches: *
51 changes: 40 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,46 @@
# vim ft=yaml

# After changing this file, check it on:
# http://yaml-online-parser.appspot.com/

# See doc/travis_notes.txt for some guidelines

# this file is *not* meant to cover or endorse the use of travis, but rather to
# help confirm pull requests to this project.

dist: xenial # Ubuntu 16.04

env:
global:
- DISPLAY=""

language: python
python:
- "3.7"
# command to install dependencies

matrix:
include:
- python: 3.6
env: TOXENV=py36
- python: 3.7
env: TOXENV=py37

# See http://docs.travis-ci.com/user/caching/#pip-cache
cache: pip

install:
- pip install -e .
- pip install -r requirements.txt
- pip install -r tests/requirements.txt
- pip install -U numpy
- pip install -r ./tests/requirements.txt
- pip --version ; pip list

# keep build from timing out
dist: xenial

# command to run tests
script:
- py.test -v # or py.test for Python versions 3.5 and below
# integration
- tox --sitepackages
- python setup.py install --dry-run

after_success:
- coverage report
# disable auto coverage bc it isn't accurate since it misses gpu code.
# to get coverage, run local and push results
# - codecov

notifications:
email: false
39 changes: 33 additions & 6 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
graft docs
# Manifest syntax https://docs.python.org/2/distutils/sourcedist.html
graft wheelhouse

include COPYING
include AUTHORS
recursive-include birl *.py
recursive-exclude __pycache__ *.py[cod] *.orig

recursive-include src/einsteinpy/tests *.py *.html
# Include the README
include *.md

prune docs/source/examples/.ipynb_checkpoints
global-exclude *.py[cod] __pycache__ *.so *.dylib
# Include the license file
include LICENSE

exclude *.sh
exclude *.toml
recursive-include examples *.py
recursive-include pytorch_lightning *.py

# exclude tests from package
recursive-exclude tests *
exclude tests

# Exclude the documentation files
recursive-exclude docs *
exclude docs

# Include the Requirements
include requirements.txt

# Exclude build configs
exclude *.yml

prune .git
prune .github
prune notebook*
prune temp*
prune test*
63 changes: 26 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
<p align="center">
<a href="https://williamfalcon.github.io/pytorch-lightning/">
<img alt="" src="https://github.com/williamFalcon/pytorch-lightning/blob/master/docs/source/_static/lightning_logo.png" width="50">
</a>
</p>
<h3 align="center">
PyTorch Lightning
</h3>
<p align="center">
The PyTorch Keras for ML researchers. More control. Less boilerplate.
</p>

<p align="center">
<a href="https://badge.fury.io/py/pytorch-lightning"><img src="https://badge.fury.io/py/pytorch-lightning.svg" alt="PyPI version" height="18"></a>
<a href="https://pepy.tech/project/pytorch-lightning"><img src="https://pepy.tech/badge/pytorch-lightning" alt="PyPI version" height="18"></a>
<a href="https://pepy.tech/project/pytorch-lightning"><img src="https://img.shields.io/badge/python-3.6-blue.svg" alt="Supported Python Version" height="18"></a>
<a href="https://github.com/williamFalcon/pytorch-lightning/blob/master/tests/README.md#running-coverage"><img src="https://github.com/williamFalcon/pytorch-lightning/blob/master/coverage.svg"></a>
<a href="https://travis-ci.org/williamFalcon/pytorch-lightning"><img src="https://travis-ci.org/williamFalcon/pytorch-lightning.svg?branch=master"></a>
<a href="https://williamfalcon.github.io/pytorch-lightning/"><img src="https://readthedocs.org/projects/pytorch-lightning/badge/?version=latest"></a>
<a href="https://github.com/williamFalcon/pytorch-lightning/blob/master/LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a>
</p>
<div align="center">

![Logo](./docs/source/_static/lightning_logo_small.png)

# PyTorch Lightning

**The PyTorch Keras for ML researchers. More control. Less boilerplate.**


[![PyPI Status](https://badge.fury.io/py/pytorch-lightning.svg)](https://badge.fury.io/py/pytorch-lightning)
[![PyPI Status](https://pepy.tech/badge/pytorch-lightning)](https://pepy.tech/project/pytorch-lightning)
[![Build Status](https://travis-ci.org/williamFalcon/pytorch-lightning.svg?branch=master)](https://travis-ci.org/williamFalcon/pytorch-lightning)
<!--
removed until windows install issues resolved.
[![Build status](https://ci.appveyor.com/api/projects/status/rum89d7hq8l1kfye?svg=true)](https://ci.appveyor.com/project/Borda/pytorch-lightning) -->
[![codecov](https://codecov.io/gh/Borda/pytorch-lightning/branch/master/graph/badge.svg)](https://codecov.io/gh/Borda/pytorch-lightning)
[![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=latest)](https://pytorch-lightning.readthedocs.io/en/latest)
[![license](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/williamFalcon/pytorch-lightning/blob/master/LICENSE)

</div>

Simple installation from PyPI
```bash
pip install pytorch-lightning
```
Expand Down Expand Up @@ -127,7 +128,7 @@ trainer = Trainer(experiment=exp, max_nb_epochs=1, train_percent_check=0.1)
trainer.fit(model)

# view tensorflow logs
print(f'View tensorboard logs by running\ntensorboard --logdir {os.getcwd()}')
print('View tensorboard logs by running\ntensorboard --logdir %s' % os.getcwd())
print('and going to http://localhost:6006 on your browser')
```

Expand All @@ -137,11 +138,7 @@ print('and going to http://localhost:6006 on your browser')
Everything in gray!
You define the blue parts using the LightningModule interface:

<p align="center">
<a href="https://github.com/williamFalcon/pytorch-lightning/blob/master/docs/source/_static/overview_flat.jpg">
<img alt="" src="https://github.com/williamFalcon/pytorch-lightning/blob/master/docs/source/_static/overview_flat.jpg" height="700px">
</a>
</p>
![Ouverview](./docs/source/_static/overview_flat.jpg)

```{.python}
# what to do in the training loop
Expand Down Expand Up @@ -223,19 +220,11 @@ def validation_end(self, outputs):
## Tensorboard
Lightning is fully integrated with tensorboard.

<p align="center">
<a href="https://williamfalcon.github.io/pytorch-lightning/Trainer/Logging/#tensorboard-support">
<img alt="" src="https://github.com/williamFalcon/pytorch-lightning/blob/master/docs/source/_static/tf_loss.png" width="900px">
</a>
</p>
![tensorboard-support](./docs/source/_static/tf_loss.png)

Lightning also adds a text column with all the hyperparameters for this experiment.

<p align="center">
<a href="https://williamfalcon.github.io/pytorch-lightning/Trainer/Logging/#tensorboard-support">
<img alt="" src="https://github.com/williamFalcon/pytorch-lightning/blob/master/docs/source/_static/tf_tags.png" width="900px">
</a>
</p>
![tensorboard-support](./docs/source/_static/tf_tags.png)

Simply note the path you set for the Experiment
``` {.python}
Expand Down
66 changes: 66 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# https://www.appveyor.com/docs/appveyor-yml/
environment:

# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script interpreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C obvci_appveyor_python_build_env.cmd"

matrix:
# Pre-installed Python versions, which Appveyor may upgrade to
# a later point release.
# See: http://www.appveyor.com/docs/installed-software#python


# - PYTHON: "C:\\Python35-x64"
# PYTHON_VERSION: "3.5.x"
# PYTHON_ARCH: "64"
# TOXENV: "py35"

- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.x"
PYTHON_ARCH: "64"
TOXENV: "py36"
PIP_PYVER: "36"

- PYTHON: "C:\\Python37-x64"
PYTHON_VERSION: "3.7.x"
PYTHON_ARCH: "64"
TOXENV: "py37"
PIP_PYVER: "37"

build: off

# https://www.appveyor.com/docs/build-cache/
cache:
- C:\ProgramData\chocolatey\bin -> appveyor.yml
- C:\ProgramData\chocolatey\lib -> appveyor.yml
- '%LOCALAPPDATA%\pip\Cache -> appveyor.yml'

# scripts that run after cloning repository
install:
# If there is a newer build queued for the same PR, cancel this one.
# The AppVeyor 'rollout builds' option is supposed to serve the same
# purpose but it is problematic because it tends to cancel builds pushed
# directly to master instead of just PR builds (or the converse).
- SET PATH=%PYTHON%;%PYTHON%\\Scripts;%path%
- pip install -U --user pip
- pip install "https://download.pytorch.org/whl/cu90/torch-1.1.0-cp%PIP_PYVER%-cp%PIP_PYVER%m-win_amd%PYTHON_ARCH%.whl"
pip install "https://download.pytorch.org/whl/cu90/torchvision-0.3.0-cp%PIP_PYVER%-cp%PIP_PYVER%m-win_amd%PYTHON_ARCH%.whl"
- pip install -r requirements.txt
- pip install -r ./tests/requirements.txt

# scripts to run before tests (working directory and environment changes are persisted from the previous steps such as "before_build")
before_test:
- python --version
- pip --version
- pip list
- dir

# to run your custom scripts instead of automatic tests
test_script:
- tox --sitepackages --parallel auto

on_success:
- coverage report
# - codecov
21 changes: 0 additions & 21 deletions coverage.svg

This file was deleted.

2 changes: 1 addition & 1 deletion docs/Trainer/Distributed training.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ cluster.add_command('export NCCL_SOCKET_IFNAME=^docker0,lo')
cluster.add_command('export NCCL_DEBUG=INFO')

# setting a master port here is a good idea.
cluster.add_command(f'export MASTER_PORT={PORT}')
cluster.add_command('export MASTER_PORT=%r' % PORT)

# good to load the latest NCCL version
cluster.load_modules(['NCCL/2.4.7-1-cuda.10.0'])
Expand Down
Binary file added docs/source/_static/lightning_logo_medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/lightning_logo_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion examples/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from .new_project_templates.lightning_module_template import LightningTemplateModel
from .new_project_templates.lightning_module_template import LightningTemplateModel

__all__ = [
'LightningTemplateModel'
]
Loading