You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Excuse me, when I carefully read you code about the function _create_ngcf_embed, I can't understand the code well. Below is the implementation of embedding propagation layer:
for k in range(0, self.n_layers):
temp_embed = []
for f in range(self.n_fold):
# 將每一段adj子矩陣都和ego相乘
temp_embed.append(tf.sparse_tensor_dense_matmul(A_fold_hat[f], ego_embeddings))
# sum messages of neighbors.
side_embeddings = tf.concat(temp_embed, 0)
# transformed sum messages of neighbors.
sum_embeddings = tf.nn.leaky_relu(
tf.matmul(side_embeddings, self.weights['W_gc_%d' % k]) + self.weights['b_gc_%d' % k])
# bi messages of neighbors.
bi_embeddings = tf.multiply(ego_embeddings, side_embeddings)
# transformed bi messages of neighbors.
bi_embeddings = tf.nn.leaky_relu(
tf.matmul(bi_embeddings, self.weights['W_bi_%d' % k]) + self.weights['b_bi_%d' % k])
# non-linear activation.
ego_embeddings = sum_embeddings + bi_embeddings
# message dropout.
ego_embeddings = tf.nn.dropout(
ego_embeddings, 1 - self.mess_dropout[k])
# normalize the distribution of embeddings.
norm_embeddings = tf.math.l2_normalize(ego_embeddings, axis=1)
all_embeddings += [norm_embeddings]
And here is the corresponding equation in the paper:
Can you explain the relation of the code and the equation, please?
Thank you!
The text was updated successfully, but these errors were encountered:
Excuse me, when I carefully read you code about the function
_create_ngcf_embed
, I can't understand the code well. Below is the implementation of embedding propagation layer:And here is the corresponding equation in the paper:
Can you explain the relation of the code and the equation, please?
Thank you!
The text was updated successfully, but these errors were encountered: