Skip to content

Commit c5b6cee

Browse files
Jonathan DEKHTIARzsdonghao
authored andcommitted
tl.layers API Refactoring and various modifications (#667)
* Decorators API Refactored * extra_requires `all`, `all_cpu` and `all_gpu` added * Error fix * YAPF Formating Correction * Test for private method decorator added * Test Logging Verbosity Fixed to Debug when runned individually * YAPF corrections applied * Changelog Added * Changelog updated * PR number changed * First Refactoring Pass done * cleaning second pass * Refactoring 3rd pass * Refactoring 4th Pass * Code Error fix * YAPF Formating Fix * Arguments now using self * YAPF error correction * Bug Fix in Decorator * act name bug fix * Error Correction * YAPF formating fix * Useless tf.identity removed * Error Fix * Changelog Updated * Error fix in tl.activation * Documentation error fix * Lazy Import added * Import Refactoring with LazyImport when necessary * Changelog Updated * Gitter Removed * Fixed proposed by @zsdonghao * Documentation updated * Missing requirements added * Update to TensorLayer 1.8.6rc1 * Requirements error fix * Docker Files updated
1 parent cc39503 commit c5b6cee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1231
-1073
lines changed

CHANGELOG.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,21 @@ To release a new version, please update the changelog as followed:
7171
### Added
7272
- API:
7373
- `tl.alphas` and `tl.alphas_like` added following the tf.ones/zeros and tf.zeros_like/ones_like (by @DEKHTIARJonathan in #580)
74+
- `tl.lazy_imports.LazyImport` to import heavy libraries only when necessary (by @DEKHTIARJonathan in #667)
7475
- CI Tool:
7576
- [Stale Probot](https://github.com/probot/stale) added to clean stale issues (by @DEKHTIARJonathan in #573)
7677
- [Changelog Probot](https://github.com/mikz/probot-changelog) Configuration added (by @DEKHTIARJonathan in #637)
7778
- Travis Builds now handling a matrix of TF Version from TF==1.6.0 to TF==1.8.0 (by @DEKHTIARJonathan in #644)
7879
- CircleCI added to build and upload Docker Containers for each PR merged and tag release (by @DEKHTIARJonathan in #648)
7980
- Decorator:
8081
- `tl.decorators` API created including `deprecated_alias` and `private_method` (by @DEKHTIARJonathan in #660)
81-
- Docker:
82+
- Docker:
8283
- Containers for each release and for each PR merged on master built (by @DEKHTIARJonathan in #648)
83-
- Containers built in the following configurations (by @DEKHTIARJonathan in #648):
84+
- Containers built in the following configurations (by @DEKHTIARJonathan in #648):
8485
- py2 + cpu
8586
- py2 + gpu
8687
- py3 + cpu
87-
- py3 + gpu
88+
- py3 + gpu
8889
- Documentation:
8990
- Release semantic version added on index page (by @DEKHTIARJonathan in #633)
9091
- Optimizers page added (by @DEKHTIARJonathan in #636)
@@ -121,10 +122,15 @@ To release a new version, please update the changelog as followed:
121122
- Ternary Convolution Layer added in unittest (by @DEKHTIARJonathan in #658)
122123
- Convolution Layers unittests have been cleaned & refactored (by @DEKHTIARJonathan in #658)
123124
- All the tests are now using a DEBUG level verbosity when run individualy (by @DEKHTIARJonathan in #660)
125+
- `tf.identity` as activation is **ignored**, thus reducing the size of the graph by removing useless operation (by @DEKHTIARJonathan in #667)
126+
- argument dictionaries are now checked and saved within the `Layer` Base Class (by @DEKHTIARJonathan in #667)
124127

125128
### Deprecated
129+
- `tl.layers.TimeDistributedLayer` argurment `args` is deprecated in favor of `layer_args` (by @DEKHTIARJonathan in #667)
126130

127131
### Removed
132+
- `assert()` calls remove and replaced by `raise AssertionError()` (by @DEKHTIARJonathan in #667)
133+
- `tl.identity` is removed, not used anymore and deprecated for a long time (by @DEKHTIARJonathan in #667)
128134

129135
### Fixed
130136
- Issue #498 - Deprecation Warning Fix in `tl.layers.RNNLayer` with `inspect` (by @DEKHTIARJonathan in #574)
@@ -135,10 +141,11 @@ To release a new version, please update the changelog as followed:
135141
- Error in `tl.layers.TernaryConv2d` fixed - self.inputs not defined (by @DEKHTIARJonathan in #658)
136142
- Deprecation warning fixed in `tl.layers.binary._compute_threshold()` (by @DEKHTIARJonathan in #658)
137143
- All references to `tf.logging` replaced by `tl.logging` (by @DEKHTIARJonathan in #661)
144+
- Duplicated code removed when bias was used (by @DEKHTIARJonathan in #667)
138145
- Tutorial:
139146
- `tutorial_word2vec_basic.py` saving issue #476 fixed (by @DEKHTIARJonathan in #635)
140147
- All tutorials tested and errors have been fixed (by @DEKHTIARJonathan in #635)
141-
148+
142149
### Security
143150

144151
### Dependencies Update
@@ -149,25 +156,26 @@ To release a new version, please update the changelog as followed:
149156
### Contributors
150157
@lgarithm @DEKHTIARJonathan @2wins @One-sixth @zsdonghao @luomai
151158

152-
## [1.8.6] - 2018-05-30
159+
## [1.8.6] - 2018-06-02
153160

154161
### Added
155162
- API:
156163
- `tl.alphas` and `tl.alphas_like` added following the tf.ones/zeros and tf.zeros_like/ones_like (by @DEKHTIARJonathan in #580)
164+
- `tl.lazy_imports.LazyImport` to import heavy libraries only when necessary (by @DEKHTIARJonathan in #667)
157165
- CI Tool:
158166
- [Stale Probot](https://github.com/probot/stale) added to clean stale issues (by @DEKHTIARJonathan in #573)
159167
- [Changelog Probot](https://github.com/mikz/probot-changelog) Configuration added (by @DEKHTIARJonathan in #637)
160168
- Travis Builds now handling a matrix of TF Version from TF==1.6.0 to TF==1.8.0 (by @DEKHTIARJonathan in #644)
161169
- CircleCI added to build and upload Docker Containers for each PR merged and tag release (by @DEKHTIARJonathan in #648)
162170
- Decorator:
163171
- `tl.decorators` API created including `deprecated_alias` and `private_method` (by @DEKHTIARJonathan in #660)
164-
- Docker:
172+
- Docker:
165173
- Containers for each release and for each PR merged on master built (by @DEKHTIARJonathan in #648)
166-
- Containers built in the following configurations (by @DEKHTIARJonathan in #648):
174+
- Containers built in the following configurations (by @DEKHTIARJonathan in #648):
167175
- py2 + cpu
168176
- py2 + gpu
169177
- py3 + cpu
170-
- py3 + gpu
178+
- py3 + gpu
171179
- Documentation:
172180
- Release semantic version added on index page (by @DEKHTIARJonathan in #633)
173181
- Optimizers page added (by @DEKHTIARJonathan in #636)
@@ -204,6 +212,15 @@ To release a new version, please update the changelog as followed:
204212
- Ternary Convolution Layer added in unittest (by @DEKHTIARJonathan in #658)
205213
- Convolution Layers unittests have been cleaned & refactored (by @DEKHTIARJonathan in #658)
206214
- All the tests are now using a DEBUG level verbosity when run individualy (by @DEKHTIARJonathan in #660)
215+
- `tf.identity` as activation is **ignored**, thus reducing the size of the graph by removing useless operation (by @DEKHTIARJonathan in #667)
216+
- argument dictionaries are now checked and saved within the `Layer` Base Class (by @DEKHTIARJonathan in #667)
217+
218+
### Deprecated
219+
- `tl.layers.TimeDistributedLayer` argurment `args` is deprecated in favor of `layer_args` (by @DEKHTIARJonathan in #667)
220+
221+
### Removed
222+
- `assert()` calls remove and replaced by `raise AssertionError()` (by @DEKHTIARJonathan in #667)
223+
- `tl.identity` is removed, not used anymore and deprecated for a long time (by @DEKHTIARJonathan in #667)
207224

208225
### Fixed
209226
- Issue #498 - Deprecation Warning Fix in `tl.layers.RNNLayer` with `inspect` (by @DEKHTIARJonathan in #574)
@@ -214,6 +231,7 @@ To release a new version, please update the changelog as followed:
214231
- Error in `tl.layers.TernaryConv2d` fixed - self.inputs not defined (by @DEKHTIARJonathan in #658)
215232
- Deprecation warning fixed in `tl.layers.binary._compute_threshold()` (by @DEKHTIARJonathan in #658)
216233
- All references to `tf.logging` replaced by `tl.logging` (by @DEKHTIARJonathan in #661)
234+
- Duplicated code removed when bias was used (by @DEKHTIARJonathan in #667)
217235
- Tutorial:
218236
- `tutorial_word2vec_basic.py` saving issue #476 fixed (by @DEKHTIARJonathan in #635)
219237
- All tutorials tested and errors have been fixed (by @DEKHTIARJonathan in #635)
@@ -265,6 +283,6 @@ To release a new version, please update the changelog as followed:
265283
### Contributors
266284
@zsdonghao @luomai @DEKHTIARJonathan
267285

268-
[Unreleased]: https://github.com/tensorlayer/tensorlayer/compare/1.8.6rc0...master
269-
[1.8.6]: https://github.com/tensorlayer/tensorlayer/compare/1.8.6rc0...1.8.5
286+
[Unreleased]: https://github.com/tensorlayer/tensorlayer/compare/1.8.6rc1...master
287+
[1.8.6]: https://github.com/tensorlayer/tensorlayer/compare/1.8.6rc1...1.8.5
270288
[1.8.5]: https://github.com/tensorlayer/tensorlayer/compare/1.8.4...1.8.5

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[![Build Status](https://img.shields.io/travis/tensorlayer/tensorlayer.svg?label=Travis&branch=master)](https://travis-ci.org/tensorlayer/tensorlayer)
88
[![PyPI version](https://badge.fury.io/py/tensorlayer.svg)](https://pypi.org/project/tensorlayer/)
9-
[![Github commits (since latest release)](https://img.shields.io/github/commits-since/tensorlayer/tensorlayer/latest.svg)](https://github.com/tensorlayer/tensorlayer/compare/1.8.6rc0...master)
9+
[![Github commits (since latest release)](https://img.shields.io/github/commits-since/tensorlayer/tensorlayer/latest.svg)](https://github.com/tensorlayer/tensorlayer/compare/1.8.6rc1...master)
1010
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tensorlayer.svg)](https://pypi.org/project/tensorlayer/)
1111
[![Supported TF Version](https://img.shields.io/badge/tensorflow-1.6.0+-blue.svg)](https://github.com/tensorflow/tensorflow/releases)
1212
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/ca2a29ddcf7445588beff50bee5406d9)](https://app.codacy.com/app/tensorlayer/tensorlayer)
@@ -16,7 +16,6 @@
1616
[![Documentation Status](https://img.shields.io/readthedocs/tensorlayer/latest.svg?label=ReadTheDocs-EN)](https://tensorlayer.readthedocs.io/)
1717
[![Documentation Status](https://img.shields.io/readthedocs/tensorlayercn/latest.svg?label=ReadTheDocs-CN)](https://tensorlayercn.readthedocs.io/)
1818
[![PyUP Updates](https://pyup.io/repos/github/tensorlayer/tensorlayer/shield.svg)](https://pyup.io/repos/github/tensorlayer/tensorlayer/)
19-
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tensorlayer/Lobby)
2019

2120
<br/>
2221

README.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
:target: https://pypi.org/project/tensorlayer/
1414

1515
.. image:: https://img.shields.io/github/commits-since/tensorlayer/tensorlayer/latest.svg
16-
:target: https://github.com/tensorlayer/tensorlayer/compare/1.8.6rc0...master
16+
:target: https://github.com/tensorlayer/tensorlayer/compare/1.8.6rc1...master
1717

1818
.. image:: https://img.shields.io/pypi/pyversions/tensorlayer.svg
1919
:target: https://pypi.org/project/tensorlayer/
@@ -45,9 +45,6 @@
4545
.. image:: https://pyup.io/repos/github/tensorlayer/tensorlayer/shield.svg
4646
:target: https://pyup.io/repos/github/tensorlayer/tensorlayer/
4747

48-
.. image:: https://badges.gitter.im/Join%20Chat.svg
49-
:target: https://gitter.im/tensorlayer/Lobby
50-
5148
.. raw:: html
5249

5350
<br/><br/>

docker/python2/cpu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN if [ -z "$TL_VERSION" ]; then \
1212
&& cd /tensorlayer_dist/ \
1313
&& git clone https://github.com/tensorlayer/tensorlayer.git \
1414
&& cd tensorlayer \
15-
&& pip install -e .[db,dev,doc,extra,test] \
15+
&& pip install -e .[all] \
1616
&& rm -rf /var/lib/apt/lists/* ; \
1717
else \
1818
echo "Building Tag Release:" "$TL_VERSION" \

docker/python2/gpu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN if [ -z "$TL_VERSION" ]; then \
1212
&& cd /tensorlayer_dist/ \
1313
&& git clone https://github.com/tensorlayer/tensorlayer.git \
1414
&& cd tensorlayer \
15-
&& pip install -e .[db,dev,doc,extra,test] \
15+
&& pip install -e .[all] \
1616
&& rm -rf /var/lib/apt/lists/* ; \
1717
else \
1818
echo "Building Tag Release:" "$TL_VERSION" \

docker/python3/cpu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN if [ -z "$TL_VERSION" ]; then \
1212
&& cd /tensorlayer_dist/ \
1313
&& git clone https://github.com/tensorlayer/tensorlayer.git \
1414
&& cd tensorlayer \
15-
&& pip install -e .[db,dev,doc,extra,test] \
15+
&& pip install -e .[all] \
1616
&& rm -rf /var/lib/apt/lists/* ; \
1717
else \
1818
echo "Building Tag Release:" "$TL_VERSION" \

docker/python3/gpu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN if [ -z "$TL_VERSION" ]; then \
1212
&& cd /tensorlayer_dist/ \
1313
&& git clone https://github.com/tensorlayer/tensorlayer.git \
1414
&& cd tensorlayer \
15-
&& pip install -e .[db,dev,doc,extra,test] \
15+
&& pip install -e .[all] \
1616
&& rm -rf /var/lib/apt/lists/* ; \
1717
else \
1818
echo "Building Tag Release:" "$TL_VERSION" \

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
# The name for this set of Sphinx documents.
146146
# "<project> v<release> documentation" by default.
147147
#
148-
# html_title = 'TensorLayer v1.8.5'
148+
# html_title = 'TensorLayer'
149149

150150
# A shorter title for the navigation bar. Default is the same as html_title.
151151
#

docs/modules/activation.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,13 @@ For more complex activation, TensorFlow API will be required.
2626

2727
.. autosummary::
2828

29-
identity
3029
ramp
3130
leaky_relu
3231
swish
3332
sign
3433
hard_tanh
3534
pixel_wise_softmax
3635

37-
Identity
38-
-------------
39-
.. autofunction:: identity
40-
4136
Ramp
4237
------
4338
.. autofunction:: ramp

example/tutorial_binarynet_cifar10_tfrecord.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def model(x_crop, y_, reuse):
173173
net = tl.layers.BinaryDenseLayer(net, 384, act=tf.nn.relu, name='d1relu')
174174
net = tl.layers.SignLayer(net)
175175
net = tl.layers.BinaryDenseLayer(net, 192, act=tf.nn.relu, name='d2relu')
176-
net = tl.layers.DenseLayer(net, 10, act=tf.identity, name='output')
176+
net = tl.layers.DenseLayer(net, 10, act=None, name='output')
177177

178178
y = net.outputs
179179

0 commit comments

Comments
 (0)