Skip to content

Commit

Permalink
Merge branch 'master' into feature/401_dcgan
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-clem authored Jan 17, 2021
2 parents 9058db1 + 413b9df commit 2c0d4d0
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 67 deletions.
11 changes: 11 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
documentation:
- docs/**/*

callback:
- pl_bolts/callbacks/**/*

datamodule:
- pl_bolts/datamodules/**/*

model:
- pl_bolts/models/**/*
13 changes: 13 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Labeler

on:
pull_request_target:
types: [opened, reopened]

jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
57 changes: 30 additions & 27 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,58 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] - YYYY-MM-DD
## [0.3.0] - 2021-01-15

### Added

- Added `input_channels` argument to UNet ([#297](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/297))

- Added SwAV ([#239](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/239), [#348](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/348), [#323](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/323))

- Added SwAV ([#239](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/239),
[#348](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/348),
[#323](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/323))
- Added data monitor callbacks `ModuleDataMonitor` and `TrainingDataMonitor` ([#285](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/285))

- Added DCGAN ([#403](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/403))

- Added `VisionDataModule` as parent class for `BinaryMNISTDataModule`, `CIFAR10DataModule`, `FashionMNISTDataModule`,
and `MNISTDataModule` ([#400](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/400))

- Added GIoU loss ([#347](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/347))

- Added IoU loss ([#469](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/469))
- Added semantic segmentation model `SemSegment` with `UNet` backend ([#259](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/259))
- Added pption to normalize latent interpolation images ([#438](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/438))
- Added flags to datamodules ([#388](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/388))
- Added metric GIoU ([#347](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/347))
- Added Intersection over Union Metric/Loss ([#469](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/469))

### Changed

- Decoupled datamodules from models ([#332](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/332), [#270](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/270))

- Decoupled datamodules from models ([#332](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/332),
[#270](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/270))
- Set PyTorch Lightning 1.0 as the minimum requirement ([#274](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/274))

- Move `pl_bolts.callbacks.self_supervised.BYOLMAWeightUpdate` to `pl_bolts.callbacks.byol_updates.BYOLMAWeightUpdate` ([#288](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/288))

- Move `pl_bolts.callbacks.self_supervised.SSLOnlineEvaluator` to `pl_bolts.callbacks.ssl_online.SSLOnlineEvaluator` ([#288](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/288))

- Move `pl_bolts.datamodules.*_dataset` to `pl_bolts.datasets.*_dataset` ([#275](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/275))
- Moved `pl_bolts.callbacks.self_supervised.BYOLMAWeightUpdate` to `pl_bolts.callbacks.byol_updates.BYOLMAWeightUpdate` ([#288](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/288))
- Moved `pl_bolts.callbacks.self_supervised.SSLOnlineEvaluator` to `pl_bolts.callbacks.ssl_online.SSLOnlineEvaluator` ([#288](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/288))
- Moved `pl_bolts.datamodules.*_dataset` to `pl_bolts.datasets.*_dataset` ([#275](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/275))
- Ensured sync across val/test step when using DDP ([#371](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/371))
- Refactored CLI arguments of models ([#394](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/394))
- Upgraded DQN to use `.log` ([#404](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/404))
- Decoupled DataModules from models - CPCV2 ([#386](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/386))
- Refactored datamodules/datasets ([#338](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/338))
- Refactored Vision DataModules ([#400](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/400))
- Refactored `pl_bolts.callbacks` ([#477](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/477))
- Refactored the rest of `pl_bolts.models.self_supervised` ([#481](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/481),
[#479](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/479)

### Fixed

- Fixed duplicate warnings when optional packages are unavailable ([#341](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/341))

- Fixed ModuleNotFoundError when importing datamoules ([#303](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/303))

- Fixed `ModuleNotFoundError` when importing datamoules ([#303](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/303))
- Fixed cyclic imports in `pl_bolts.utils.self_suprvised` ([#350](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/350))

- Fixed VAE loss to use KL term of ELBO ([#330](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/330))

- Fixed dataloders of `MNISTDataModule` to use `self.batch_size` ([#331](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/331))

- Fixed missing `outputs` in SSL hooks for PyTorch Lightning 1.0 ([#277](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/277))

### Removed

### Deprecated
- Fixed stl10 datamodule ([#369](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/369))
- Fixes SimCLR transforms ([#329](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/329))
- Fixed binary MNIST datamodule ([#377](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/377))
- Fixed the end of batch size mismatch ([#389](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/389))
- Fixed `batch_size` parameter for DataModules remaining ([#344](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/344))
- Fixed CIFAR `num_samples` ([#432](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/432))

## [0.2.5] - 2020-10-12

Expand All @@ -67,7 +71,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Enabled PyTorch Lightning 0.10 compatibility ([#264](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/264))
- Added dummy datasets ([#266](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/266))
- Added semantic segmentation model `SemSegment` with `UNet` backend ([#259](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/259))
- Added `KittiDataModule` ([#248](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/248))
- Added `UNet` ([#247](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/247))
- Added reinforcement learning models, losses and datamodules ([#257](https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/257))
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
[![Slack](https://img.shields.io/badge/slack-chat-green.svg?logo=slack)](https://join.slack.com/t/pytorch-lightning/shared_invite/zt-f6bl2l0l-JYMK3tbAgAmGRrlNr00f1A)
[![Discourse status](https://img.shields.io/discourse/status?server=https%3A%2F%2Fforums.pytorchlightning.ai)](https://forums.pytorchlightning.ai/)
[![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-Oct%2005-purple.svg)](https://shields.io/)
-->

</div>

Expand All @@ -50,9 +53,9 @@

| System / PyTorch ver. | 1.6 (min. req.) | 1.7 (latest) |
| :---: | :---: | :---: |
| Linux py3.6 / py3.7 / py3.8 | ![CI full testing](https://github.com/PyTorchLightning/pytorch-lightning-bolts/workflows/CI%20full%20testing/badge.svg?branch=master&event=push) | ![CI full testing](https://github.com/PyTorchLightning/pytorch-lightning-bolts/workflows/CI%20full%20testing/badge.svg?branch=master&event=push) |
| OSX py3.6 / py3.7 | ![CI full testing](https://github.com/PyTorchLightning/pytorch-lightning-bolts/workflows/CI%20full%20testing/badge.svg?branch=master&event=push) | ![CI full testing](https://github.com/PyTorchLightning/pytorch-lightning-bolts/workflows/CI%20full%20testing/badge.svg?branch=master&event=push) |
| Windows py3.6 / py3.7 | ![CI full testing](https://github.com/PyTorchLightning/pytorch-lightning-bolts/workflows/CI%20full%20testing/badge.svg?branch=master&event=push) | ![CI full testing](https://github.com/PyTorchLightning/pytorch-lightning-bolts/workflows/CI%20full%20testing/badge.svg?branch=master&event=push) |
| Linux py3.{6,7,8} | ![CI full testing](https://github.com/PyTorchLightning/pytorch-lightning-bolts/workflows/CI%20full%20testing/badge.svg?branch=master&event=push) | ![CI full testing](https://github.com/PyTorchLightning/pytorch-lightning-bolts/workflows/CI%20full%20testing/badge.svg?branch=master&event=push) |
| OSX py3.{6,7} | ![CI full testing](https://github.com/PyTorchLightning/pytorch-lightning-bolts/workflows/CI%20full%20testing/badge.svg?branch=master&event=push) | ![CI full testing](https://github.com/PyTorchLightning/pytorch-lightning-bolts/workflows/CI%20full%20testing/badge.svg?branch=master&event=push) |
| Windows py3.{6,7} | ![CI full testing](https://github.com/PyTorchLightning/pytorch-lightning-bolts/workflows/CI%20full%20testing/badge.svg?branch=master&event=push) | ![CI full testing](https://github.com/PyTorchLightning/pytorch-lightning-bolts/workflows/CI%20full%20testing/badge.svg?branch=master&event=push) |

</center>

Expand Down
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@

# -- Project documents -------------------------------------------------------
# export the READme
# with open(os.path.join(PATH_ROOT, 'README.md'), 'r') as fp:
# with open(os.path.join(_PATH_ROOT, 'README.md'), 'r') as fp:
# readme = fp.read()
# # TODO: temp fix removing SVG badges and GIF, because PDF cannot show them
# readme = re.sub(r'(\[!\[.*\))', '', readme)
# readme = re.sub(r'(!\[.*.gif\))', '', readme)
# for dir_name in (os.path.basename(p) for p in glob.glob(os.path.join(PATH_ROOT, '*')) if os.path.isdir(p)):
# readme = readme.replace('](%s/' % dir_name, '](%s/%s/' % (PATH_ROOT, dir_name))
# for dir_name in (os.path.basename(p) for p in glob.glob(os.path.join(_PATH_ROOT, '*')) if os.path.isdir(p)):
# readme = readme.replace('](%s/' % dir_name, '](%s/%s/' % (_PATH_ROOT, dir_name))
# with open('readme.md', 'w') as fp:
# fp.write(readme)

Expand Down
2 changes: 1 addition & 1 deletion pl_bolts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os

__version__ = '0.2.6rc1'
__version__ = '0.3.0rc1'
__author__ = 'PyTorchLightning et al.'
__author_email__ = 'name@pytorchlightning.ai'
__license__ = 'Apache-2.0'
Expand Down
63 changes: 30 additions & 33 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,44 @@
except ImportError:
import __builtin__ as builtins

try:
import pytorch_lightning # noqa: F401
except ImportError:
try:
import pip
except ImportError:
raise ImportError('Missing `pip` to install custom dependencies.')
pip.main(['install', 'pytorch-lightning>=1.1.0'])

# https://packaging.python.org/guides/single-sourcing-package-version/
# http://blog.ionelmc.ro/2014/05/25/python-packaging/

PATH_ROOT = os.path.dirname(__file__)
_PATH_ROOT = os.path.dirname(__file__)
builtins.__LIGHTNING_BOLT_SETUP__: bool = True

import pl_bolts # noqa: E402


def load_requirements(path_dir=PATH_ROOT, file_name='requirements.txt', comment_char='#'):
with open(os.path.join(path_dir, file_name), 'r') as file:
lines = [ln.strip() for ln in file.readlines()]
reqs = []
for ln in lines:
if comment_char in ln: # filer all comments
ln = ln[:ln.index(comment_char)].strip()
if ln.startswith('http'): # skip directly installed dependencies
continue
if ln: # if requirement is not empty
reqs.append(ln)
return reqs
def _load_requirements(path_dir=_PATH_ROOT, file_name='requirements.txt', comment_char='#'):
from pytorch_lightning.setup_tools import _load_requirements as _lreq
return _lreq(path_dir=path_dir, file_name=file_name, comment_char=comment_char)


def _load_long_description():
from pytorch_lightning.setup_tools import _load_long_description as _lld
return _lld(_PATH_ROOT)

def load_long_describtion():
# https://github.com/PyTorchLightning/pytorch-lightning/raw/master/docs/source/_images/lightning_module/pt_to_pl.png
url = os.path.join(pl_bolts.__homepage__, 'raw', pl_bolts.__version__, 'docs')
text = open('README.md', encoding='utf-8').read()
# replace relative repository path to absolute link to the release
text = text.replace('](docs', f']({url}')
# SVG images are not readable on PyPI, so replace them with PNG
text = text.replace('.svg', '.png')
return text

def _prepare_extras():
extras = {
'loggers': _load_requirements(path_dir=os.path.join(_PATH_ROOT, 'requirements'), file_name='loggers.txt'),
'models': _load_requirements(path_dir=os.path.join(_PATH_ROOT, 'requirements'), file_name='models.txt'),
'test': _load_requirements(path_dir=os.path.join(_PATH_ROOT, 'requirements'), file_name='test.txt'),
}
extras['extra'] = extras['models'] + extras['loggers']
extras['dev'] = extras['extra'] + extras['test']
return extras

extras = {
'loggers': load_requirements(path_dir=os.path.join(PATH_ROOT, 'requirements'), file_name='loggers.txt'),
'models': load_requirements(path_dir=os.path.join(PATH_ROOT, 'requirements'), file_name='models.txt'),
'test': load_requirements(path_dir=os.path.join(PATH_ROOT, 'requirements'), file_name='test.txt'),
}
extras['extra'] = extras['models'] + extras['loggers']
extras['dev'] = extras['extra'] + extras['test']

# https://packaging.python.org/discussions/install-requires-vs-requirements /
# keep the meta-data here for simplicity in reading this file... it's not obvious
Expand All @@ -67,15 +64,15 @@ def load_long_describtion():
download_url='https://github.com/PyTorchLightning/pytorch-lightning-bolts',
license=pl_bolts.__license__,
packages=find_packages(exclude=['tests', 'docs']),
long_description=load_long_describtion(),
long_description=_load_long_description(),
long_description_content_type='text/markdown',
include_package_data=True,
zip_safe=False,
keywords=['deep learning', 'pytorch', 'AI'],
python_requires='>=3.6',
setup_requires=[],
install_requires=load_requirements(),
extras_require=extras,
setup_requires=['pytorch-lightning>=1.1.0'],
install_requires=_load_requirements(),
extras_require=_prepare_extras(),
project_urls={
"Bug Tracker": "https://github.com/PyTorchLightning/pytorch-lightning-bolts/issues",
"Documentation": "https://pytorch-lightning-bolts.rtfd.io/en/latest/",
Expand Down

0 comments on commit 2c0d4d0

Please sign in to comment.