-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
Problem with GRU simulation #20535
Comments
Hi @sachinprasadhs, |
Just by eye, your implementation looks like it could be correct given certain settings to the GRU layer. Probably easiest to actually go op by op in the call graph to debug where things get off. Keras 2.11 is quite old at this point (many years old), but you can find the implementation on the 2.11 tag on the Keras repo on github. Here's the GRU code in 2.11 (thought there's other paths for other GRU layer init args). Lines 308 to 350 in e6784e4
If I were trying to track this down, I'd give myself an isolated example and get an environment where I could hack up the layer code in GRU. Maybe start be running eagerly, and add a bunch of prints for intermediate computation values, see if that's helps triangulate, go from there. |
Hello,
I am going to implement the GRU computations in my code and compare the results with the output of a GRU layer. To this end, I am using a same input for both cases and get the weights of GRU and pass it to my_GRU_simulation function. By using the following code for inner gates calculations, I get two different outputs for these two cases.
Is there any extra calculations (rather than following) that I have missed?
How can I create the exactly same output as a GRU layer?
previous_gru_output is all zero with GRU units size.
I am using tensorflow and keras version 2.11.0
The text was updated successfully, but these errors were encountered: