-
Notifications
You must be signed in to change notification settings - Fork 2k
[Refactoring] Clean up recurrent cells and layers getConfig #3880
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
|
Regarding tfjs/tfjs-layers/src/layers/recurrent_test.ts Line 1549 in 315b68b
tfjs/tfjs-layers/src/layers/recurrent_test.ts Line 1564 in 315b68b
Not quite sure why a lot of formatting occurred. |
pyu10055
left a comment
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 refactoring, on high level can you explain your approach to eliminate the manual hierarchical construction of the config?
Reviewable status: 0 of 1 approvals obtained
@pyu10055 Sure, here are my observations.
|
pyu10055
left a comment
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 explanation, overall your change looks good to me.
Can you add tests that verify the config generated in the new way matches to the config generated by original code? thanks
Reviewable status: 0 of 1 approvals obtained (waiting on @dikatok)
tfjs-layers/src/layers/recurrent_test.ts, line 1564 at r1 (raw file):
const yPrime = layer.apply(x) as Tensor; expectTensorsClose(yPrime, y); expect(layerPrime.getConfig()['recurrentActivation'])
can you test against a constant config, comparing two same type of layers does not seem to guarantee no change to the exist behavior.
Added the requested tests, all values were generated from the previous version of the code. I think the new tests resolve your last comment as well? |
|
@pyu10055 friendly ping 🦝 |
pyu10055
left a comment
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 you for the refactoring!
Reviewed 3 of 3 files at r2, 1 of 1 files at r3.
Reviewable status:complete! 1 of 1 approvals obtained (waiting on @pyu10055)
pyu10055
left a comment
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.
Reviewable status: 0 of 1 approvals obtained (waiting on @dikatok)
tfjs-layers/src/layers/recurrent_test.ts, line 1564 at r1 (raw file):
Previously, dikatok (Andika Tanuwijaya) wrote…
Added the requested tests, all values were generated from the previous version of the code. I think the new tests resolve your last comment as well?
thank you for adding the detail tests.
pyu10055
left a comment
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.
Reviewed 2 of 2 files at r4.
Reviewable status:complete! 1 of 1 approvals obtained (waiting on @dikatok)
The purpose of this PR is to clean up the
getConfigmethod related torecurrentandconvolutional_recurrentlayers and cells for better readability.This change is