Skip to content

Commit 423fdb6

Browse files
Smokrowseanpmorgan
authored andcommitted
Implementation of Normalizations (#14)
* Implemented GroupNorm,InstanceNorm and LayerNorm
1 parent ee74c18 commit 423fdb6

File tree

6 files changed

+661
-8
lines changed

6 files changed

+661
-8
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ developments that cannot be integrated into core TensorFlow
1717
|:----------------------- |:----------- |:---------------------------- |
1818
| tfa.activations | Sparsemax | https://arxiv.org/abs/1602.02068 |
1919
| tfa.image | transform | |
20+
| tfa.layers | GroupNormalization | https://arxiv.org/abs/1803.08494 |
21+
| tfa.layers | InstanceNormalization | https://arxiv.org/abs/1607.08022 |
22+
| tfa.layers | LayerNormalization | https://arxiv.org/abs/1607.06450 |
2023
| tfa.layers | Maxout | https://arxiv.org/abs/1302.4389 |
2124
| tfa.layers | PoinareNormalize | https://arxiv.org/abs/1705.08039 |
2225
| tfa.layers | WeightNormalization | https://arxiv.org/abs/1602.07868 |

tensorflow_addons/layers/BUILD

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ py_library(
88
"__init__.py",
99
"python/__init__.py",
1010
"python/maxout.py",
11+
"python/normalizations.py",
1112
"python/poincare.py",
1213
"python/sparsemax.py",
1314
"python/wrappers.py",
@@ -29,7 +30,7 @@ py_test(
2930
srcs_version = "PY2AND3",
3031
deps = [
3132
":layers_py",
32-
],
33+
]
3334
)
3435

3536
py_test(
@@ -55,18 +56,18 @@ py_test(
5556
srcs_version = "PY2AND3",
5657
deps = [
5758
":layers_py",
58-
],
59+
]
5960
)
6061

6162
py_test(
62-
name = "poincare_py_test",
63-
size = "small",
63+
name = "layers_normalizations_py_test",
64+
size= "small",
6465
srcs = [
65-
"python/poincare_test.py",
66+
"python/normalizations_test.py",
6667
],
67-
main = "python/poincare_test.py",
68+
main = "python/normalizations_test.py",
6869
srcs_version = "PY2AND3",
6970
deps = [
70-
":layers_py",
71-
],
71+
":layers_py",
72+
]
7273
)

tensorflow_addons/layers/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
## Contents
44
| Layer | Reference |
55
|:----------------------- |:-----------------------------|
6+
| GroupNormalization | https://arxiv.org/abs/1803.08494 |
7+
| InstanceNormalization | https://arxiv.org/abs/1607.08022 |
8+
| LayerNormalization | https://arxiv.org/abs/1607.06450 |
69
| Maxout | https://arxiv.org/abs/1302.4389 |
710
| PoinareNormalize | https://arxiv.org/abs/1705.08039 |
811
| WeightNormalization | https://arxiv.org/abs/1602.07868 |

tensorflow_addons/layers/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
from __future__ import print_function
2020

2121
from tensorflow_addons.layers.python.maxout import Maxout
22+
from tensorflow_addons.layers.python.normalizations import GroupNormalization
23+
from tensorflow_addons.layers.python.normalizations import InstanceNormalization
24+
from tensorflow_addons.layers.python.normalizations import LayerNormalization
2225
from tensorflow_addons.layers.python.poincare import PoincareNormalize
2326
from tensorflow_addons.layers.python.sparsemax import Sparsemax
2427
from tensorflow_addons.layers.python.wrappers import WeightNormalization

0 commit comments

Comments
 (0)