Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Conditional Random Field (CRF) layer #377

Closed
Closed
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
3bcc068
Port CRF from tf.contrib to tfa.text
Squadrick Jun 13, 2019
b24ee9c
Port CRF from tf.contrib to tfa.text
Squadrick Jun 13, 2019
2b9f3f6
Port CRF from tf.contrib to tfa.text
Squadrick Jun 13, 2019
e900aed
Merge branch 'crf' of https://github.com/Squadrick/addons into crf
Squadrick Jun 19, 2019
707ed99
Format using make code-format
Squadrick Jun 19, 2019
829ac65
Add tf.function to all the CRF functions
Squadrick Jun 21, 2019
36ea1ca
Merge branch 'master' of https://github.com/tensorflow/addons into crf
Squadrick Jun 24, 2019
9140ce1
RNN call masks computation based on seq len
Squadrick Jun 24, 2019
3a8b0be
Add @tf.function to all crf functions
Squadrick Jun 24, 2019
a90b478
Rename files and minor fixes
Squadrick Jun 25, 2019
d25b747
code format
Squadrick Jun 25, 2019
34811e6
save work progress
howl-anderson Jun 25, 2019
23460eb
save work progress
howl-anderson Jun 25, 2019
a0b6b7d
remove useless file
howl-anderson Jul 22, 2019
d8d98a8
Update & bugfix
howl-anderson Jul 30, 2019
8049c55
Merge remote-tracking branch 'upstream/master' into feature/crf_layers
howl-anderson Oct 3, 2019
0b58e5f
Update code and test cases; not ready for release yet
howl-anderson Oct 3, 2019
17bfe5f
Update code
howl-anderson Oct 4, 2019
6b9d252
Update README
howl-anderson Oct 4, 2019
e961f08
Update code and BUILD: passed CI testing
howl-anderson Oct 4, 2019
3db21ee
Merge branch 'master' of https://github.com/tensorflow/addons into fe…
howl-anderson Oct 6, 2019
18c569e
Update code
howl-anderson Oct 9, 2019
6a4c8fc
Remove input_dim
howl-anderson Oct 9, 2019
28790d9
Update: using hack code to make CRF work again in TF 2.0
howl-anderson Oct 10, 2019
7040e3f
All code pasted CI testing
howl-anderson Oct 11, 2019
7822d20
Update
howl-anderson Oct 11, 2019
9db242a
Merge branch 'master' of https://github.com/tensorflow/addons into fe…
howl-anderson Oct 11, 2019
d8d2157
Update
howl-anderson Oct 11, 2019
6ca4215
Add left padding detect function but not test due to building failed
howl-anderson Oct 14, 2019
e6b48e1
Update: passed all the test
howl-anderson Oct 14, 2019
6f6fe9e
Update: tiny improvement
howl-anderson Oct 14, 2019
ce24fc4
Merge branch 'master' of https://github.com/tensorflow/addons into fe…
howl-anderson Oct 15, 2019
68a6132
Tiny improvement according to github user @OttoseiAza
howl-anderson Oct 15, 2019
75603b3
Add more metrics in test
howl-anderson Oct 15, 2019
5960add
fix code style
howl-anderson Oct 15, 2019
778160f
bugfix: Precision and Recall don't work on CRF for now
howl-anderson Oct 16, 2019
8015ea8
Add test_in_subclass_model test case which need a patch of tensorflow…
howl-anderson Oct 16, 2019
674267f
Update comment
howl-anderson Oct 17, 2019
f2eaf96
Merge branch 'master' of https://github.com/tensorflow/addons into fe…
howl-anderson Nov 11, 2019
e89a569
Merge branch 'master' of https://github.com/tensorflow/addons into fe…
howl-anderson Dec 23, 2019
e23e19c
bugfix and docfix
howl-anderson Dec 23, 2019
b262357
update
howl-anderson Dec 23, 2019
19749e8
Update and fix according to reviwer's suggetion
howl-anderson Dec 24, 2019
989cf2a
Update for clean unnecessory type cast and use dense layer inside
howl-anderson Dec 25, 2019
15104e5
Merge branch 'master' of https://github.com/tensorflow/addons into fe…
howl-anderson Jan 31, 2020
9b2bd18
Merge branch 'feature/crf_layers' of github.com:howl-anderson/addons …
howl-anderson Feb 3, 2020
484636f
Add some docs and helper script
howl-anderson Feb 3, 2020
e7940bf
Update crf design doc
howl-anderson Feb 6, 2020
68ffff3
Add CRF layer PoC notebook for PR
howl-anderson Feb 11, 2020
1d4e98c
Remove useless files
howl-anderson Feb 12, 2020
fc6527e
fix code style
howl-anderson Feb 12, 2020
78c390f
Remove useless file
howl-anderson Feb 12, 2020
2f25570
CI: rerun
howl-anderson Feb 12, 2020
4d63cb0
Merge branch 'master' of https://github.com/tensorflow/addons into fe…
howl-anderson Feb 12, 2020
ab2ad10
Add typing hint
howl-anderson Feb 13, 2020
e3d3cfe
Fix code style
howl-anderson Feb 13, 2020
42f6b33
fix TODOs
howl-anderson Feb 14, 2020
d21707c
Update doc
howl-anderson Feb 25, 2020
4004310
Update loss and loss tests
howl-anderson Feb 25, 2020
33da859
Merge branch 'master' into howl-anderson_feature/crf_layers
gabrieldemarmiesse Feb 26, 2020
24eb753
Merge branch 'master' into howl-anderson_feature/crf_layers
gabrieldemarmiesse Feb 26, 2020
86acc6e
Merge branch 'master' into howl-anderson_feature/crf_layers
gabrieldemarmiesse Mar 4, 2020
ec2f8d0
Cleanup of dev files.
gabrieldemarmiesse Mar 4, 2020
a8c0517
Removed empty files.
gabrieldemarmiesse Mar 4, 2020
e694349
Compatible only with py3
gabrieldemarmiesse Mar 4, 2020
9de6cf0
Formatting.
gabrieldemarmiesse Mar 4, 2020
50ff813
Merge branch 'master' of https://github.com/tensorflow/addons into fe…
howl-anderson Mar 25, 2020
307678d
Update CODEOWNERS
howl-anderson Mar 25, 2020
e0b5e0f
Merge branch 'feature/crf_layers' of github.com:howl-anderson/addons …
howl-anderson Mar 25, 2020
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
15 changes: 15 additions & 0 deletions tensorflow_addons/layers/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ py_library(
name = "layers",
srcs = [
"__init__.py",
"crf.py",
"gelu.py",
"maxout.py",
"normalizations.py",
Expand All @@ -20,6 +21,7 @@ py_library(
srcs_version = "PY2AND3",
deps = [
"//tensorflow_addons/activations",
"//tensorflow_addons/text",
"//tensorflow_addons/utils",
],
)
Expand Down Expand Up @@ -101,3 +103,16 @@ py_test(
":layers",
],
)

py_test(
name = "crf_test",
size = "small",
srcs = [
"crf_test.py",
],
main = "crf_test.py",
srcs_version = "PY2AND3",
deps = [
":layers",
],
)
2 changes: 2 additions & 0 deletions tensorflow_addons/layers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Maintainers
| Submodule | Maintainers | Contact Info |
|:---------- |:----------- |:------------- |
| crf | @howl-anderson | u1mail2me@gmail.com |
| gelu | @AakashKumarNain | aakashnain@outlook.com |
| maxout | @fsx950223 | fsx950223@gmail.com |
| normalizations | @smokrow | moritz.kroeger@tu-dortmund.de |
Expand All @@ -14,6 +15,7 @@
## Components
| Submodule | Layer | Reference |
|:---------- |:----------- |:------------- |
| crf | CRF | https://en.wikipedia.org/wiki/Conditional_random_field |
| gelu | GeLU | https://arxiv.org/abs/1606.08415 |
| maxout | Maxout | https://arxiv.org/abs/1302.4389 |
| normalizations | GroupNormalization | https://arxiv.org/abs/1803.08494 |
Expand Down
3 changes: 2 additions & 1 deletion tensorflow_addons/layers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@
from tensorflow_addons.layers.optical_flow import CorrelationCost
from tensorflow_addons.layers.poincare import PoincareNormalize
from tensorflow_addons.layers.sparsemax import Sparsemax
from tensorflow_addons.layers.wrappers import WeightNormalization
from tensorflow_addons.layers.wrappers import WeightNormalization
from tensorflow_addons.layers.crf import CRF
Squadrick marked this conversation as resolved.
Show resolved Hide resolved
Loading