-
Notifications
You must be signed in to change notification settings - Fork 615
Move the tf.keras.layers.PeepholeLSTMCell to tfa #1944
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
Conversation
Rebase the against upstream
This reverts commit 63d83d2.
This reverts commit c30ac7b.
This cell was exported under tf core API as an experimental since 2.0, but I think tfa should be a better place for this implementation. We are planing to deprecate and eventually remove the PeepholeLSTMCell in the tf core API once this is landed.
You are owner of some files modified in this pull request. |
@seanpmorgan, currently the CI test is failed for 2 reasons https://github.com/tensorflow/addons/pull/1944/checks?check_run_id=796216452.
|
@qlzh727 Thanks for the pull request!
|
Sure, will do.
I can't change to keras.LSTMCell since only the tf.nn.rnn_cell.LSTMCell contains the implementation of peephole. It was the base line for me to verify the numbers. Could we allow the v1.compat in test only? |
Yeah that makes sense. In addons, we're trying to show users how to write idiomatic tf 2.x code. Even if tf.compat is not going away anytime soon, we would prefer to use modern, future-proof TF code to minimize the technical debt. This was the rational when we decided to forbid tf.compat. In this case, a good alternative would be to hardcode some numbers in the tests, and check against that. That would prevent any regressions since we know that the current implementation is correct. |
We removed the v1 compat API since TFA only works with TF v2.
The cell itself doesn't have __init__ and it inherit the __init__ from keras.LSTMcell, which doesn't have type hint yet.
Done. |
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.
LGTM!
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.
LGTM Thanks!
* Move the tf.keras.layers.PeepholeLSTMCell to tfa This cell was exported under tf core API as an experimental since 2.0, but I think tfa should be a better place for this implementation. We are planing to deprecate and eventually remove the PeepholeLSTMCell in the tf core API once this is landed. * Update peephole lstm cell test with golden values. We removed the v1 compat API since TFA only works with TF v2. * Add PeepholeLSTMCell to the exception list for typehint check. The cell itself doesn't have __init__ and it inherit the __init__ from keras.LSTMcell, which doesn't have type hint yet. * Fix format. * Update build method to be more aligned with py3 style.
* Move the tf.keras.layers.PeepholeLSTMCell to tfa This cell was exported under tf core API as an experimental since 2.0, but I think tfa should be a better place for this implementation. We are planing to deprecate and eventually remove the PeepholeLSTMCell in the tf core API once this is landed. * Update peephole lstm cell test with golden values. We removed the v1 compat API since TFA only works with TF v2. * Add PeepholeLSTMCell to the exception list for typehint check. The cell itself doesn't have __init__ and it inherit the __init__ from keras.LSTMcell, which doesn't have type hint yet. * Fix format. * Update build method to be more aligned with py3 style.
This cell was exported under tf core API as an experimental since 2.0, but I think tfa should be a better place for this implementation.
We are planing to deprecate and eventually remove the PeepholeLSTMCell in the tf core API once this is landed.