GraphSAGE icon indicating copy to clipboard operation
GraphSAGE copied to clipboard

SeqAggregator

Open yeshenpy opened this issue 6 years ago • 1 comments

Hi ,I have encountered some troubles. I did not find a specific description of the LSTM part in the paper, so I have several problems: (1):initial_state = self.cell.zero_state(batch_size, tf.float32) used = tf.sign(tf.reduce_max(tf.abs(neigh_vecs), axis=2)) length = tf.reduce_sum(used, axis=1) length = tf.maximum(length, tf.constant(1.)) length = tf.cast(length, tf.int32)`

I can‘t really understand why length is defined by these code,Especially the first two lines (2):index = tf.range(0, batch_size) * max_len + (length - 1) flat = tf.reshape(rnn_outputs, [-1, out_size]) neigh_h = tf.gather(flat, index) These lines of code also bother me, and I can't understand them very well I hope to get your answer

yeshenpy avatar Feb 12 '19 14:02 yeshenpy

(1) Here we are defining length by the size of the (sampled) neighborhood. (2) neigh_h is the neighborhood embedding. Here gather is just to extract the embeddings corresponding to the index variable into a list where the i-th column is the embedding at index[i].

RexYing avatar May 28 '19 04:05 RexYing