-
Notifications
You must be signed in to change notification settings - Fork 613
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
Adding TCN Layers + Tutorial to TFA Layers #692
Conversation
Check out this pull request on You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB. |
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.
Thanks for the contribution! My main concern is why we should instantiate layers in build
instead of __init__
. Could you elaborate the reason why?
Hi Tzu-Wei @WindQAQ, thank you so much for the review, you are right that there are some layers that are not depend on the |
…yers in __init__ instead of in build
@WindQAQ I have resolved the comments you had earlier this week and updated the code, when you have time may you review the changes? Thank you so much! |
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.
@shun-lin The code looks good so far. A few changes requested.
Could you also expand the tests?
- We need tests for both
TCN
andResidualBlock
. - Check that they can be serialized and deserialized. Both the layers are currently missing
from_config
.
I haven't taken a look at the notebook yet, but I'll do that soon.
got it, thanks @Squadrick ! |
@Squadrick I believe that we don't need to extend Edit: Edit 2: |
@shun-lin Thanks for making the changes. I think you've accidentally included an extra file: I'm adding a BLOCKED tag to this PR until the issue with |
@Squadrick thanks for catching the extra file, I have removed |
@Squadrick may you unblock this PR? I think the issue with |
@shun-lin I'd prefer if we don't merge the PR until the tests are up and working. Three reasons for this:
Will |
@Squadrick you have a good point, and the tensorflow team has assigned the blocking issue to me so I will look into resolving it when I have time. In the meantime I will write more tests for |
@Squadrick so after digging inside Tensorflow Keras's codebase for tests for layers that are returning a list of Tensors, I found out that they are not using tf.keras.layers.RNN's test when the layer is set (with 'return_sequences' set to 'True) to return a list of Tensors: |
@shun-lin Thanks for looking into this. Yes, that sounds like a good idea.
Make this a TODO in the code. |
Thanks for this contribution @shun-lin. I am really interested in using TCN layers. If you need any help, let me know. I will be happy to help. |
@shun-lin any update so far on this one? :) |
Seems like the path forward here is already determined, but just wanted to mention that it was previously suggested we fork |
@pedrolarben @philipperemy @seanpmorgan I apologize for the delay, the main issue I have right now is just testing the internal Relevant Tensorflow Issue: And @pedrolarben I think @philipperemy's Keras-TCN works with TF2 now as well, https://github.com/philipperemy/keras-tcn. And @philipperemy if you have written any tests for TCN please let me know so I don't duplicate work, thanks! |
@shun-lin I can confirm that it now works well with TF2. There are no unit tests at the moment for TCN. Just a quick training test to make sure that the training converges after a couple of epochs on a simple task. |
This pull request had no activity for a while now. I'll be closing it. Feel free to open it again if there are changes. |
This PR adds TCN layer as well as the Residual Block layer to TFA layers. A colab with the basic usage of TCN layer with IMDB is also included.
TODO(shunlin):
Write more tests.
May I get some pointers on what kind of tests I should include? Thanks!
Associated Issues:
#661
philipperemy/keras-tcn#73
Source Implementations:
https://github.com/philipperemy/keras-tcn (In Pure Keras)
https://github.com/locuslab/TCN (In Pytorch)
Relevant Paper:
https://arxiv.org/pdf/1803.01271.pdf