-
Notifications
You must be signed in to change notification settings - Fork 614
CRF layer v3.0 continued #1999
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
CRF layer v3.0 continued #1999
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
@googlebot I signed it! |
Wheels build broke on Ubuntu-18.04 with Python3.5. Seems there are some problems with the docker env. Anything I need to do to pass those two checks? Looks like #2002 fixed it. |
@howl-anderson Thank you so much for your contribution. Would you mind replying with only |
@googlebot I consent. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
@facaiy @seanpmorgan Hi guys, would you mind having a look at this PR whenever you are available? The history of adding CRF layer can be dated back one year ago ( #22 #314 #377 and many other issues and PRs). Having this published will help a lot . Very appreciated! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution to this long journey 👍
Thank you a lot for this contribution! Can we use |
@luozhouyang The pattern that you said is called endpoint pattern I think. In that pattern, users need to pass true labels as one of the inputs, and I think it is not a user-friendly API. The tensorflow/tensorflow#37818 is a promising solution to this, but still under review. |
This approach can work but it's incredibly slow, especially when we have a vast amount of classes/labels. |
* Squash all. * Cleanup for easier review. * Calming the angry bazel. * Fix the strange bug. * Replaced one bug by another bug. * Minor simplification. * Fix unused parameter. * Simplified the signature. * Removing boilerplate * Unused import. * CRF layer v3.0 * Finish the conversion. * Some renaming here and there. * Added a test where some training is done after reloading the model. * Apply suggesstions from CR * update ops in _compute_mask_[left|right]_boundary Co-authored-by: howl-anderson <[email protected]> Co-authored-by: gabrieldemarmiesse <[email protected]>
This is a continued PR of #1733 by @gabrieldemarmiesse .
Several suggestions from code review were applied.
Following is the original comment.
With a subclassing approch, we have a nicer API and it's very flexible.
Works only with TF 2.2+
@howl-anderson for the review and the CLA
The plan is to show users how to do the subclassing for the CRF. We shouldn't provide and API to save them some code there because it's going to become very complex to design a good API and to maintain it later on.
So the CRF layer is a public API and for the CRF loss, we give a good tutorial about subclassing.
Quick tutorial right now: