Skip to content
This repository has been archived by the owner on Nov 12, 2021. It is now read-only.

GGNN function in tensorflow code #37

Open
Ligoon opened this issue May 12, 2020 · 0 comments
Open

GGNN function in tensorflow code #37

Ligoon opened this issue May 12, 2020 · 0 comments

Comments

@Ligoon
Copy link

Ligoon commented May 12, 2020

In ggnn function, the input shape of dynamic_rnn will be (self.batch_size * max_n_node, 1, 2 * hidden_size) = (# of all items in a batch, 1, 2 * hidden_size) and initial states' shape will be (self.batch_size * max_n_node, hidden_size) = (# of all items in a batch, hidden_size).

So there's only one time step for each sequence (the second element max_time in inputs = 1), which mean the first item vector in inputs (shape = (2 * hidden_size,)) will get the embedding after interacting with the first initial hidden state (shape = ( hidden_size,)) in only one time step. And for the second item vector in inputs will also get it's embedding with the second initial hidden state in one time step. Is that right ? If so, then there is no recurrent meaning in this RNN ?

Cause in my understanding, item should be fed into RNN time step by time step for a session, which means the hidden state (embedding) will be affected by the previous click item. I wonder why the inputs shape is (# of all items in a batch, 1, 2 * hidden_size) instead of (self.batch_size, max_n_node, 2 * hidden_size). What is the meaning of this setting in dynamic_rnn function ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant