alibaba / alibaba/euler

relation_cov code not understand

Open
#341 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.9k
Forks
553
PR merge metrics
No merged PRs in 30d

Description

in relation_conv.py, in the following funciton, edge_attr is the attribute of the edge, why we use it as an index? what does below equation get? matrix = tf.gather(self.matrix, edge_attr)

def apply_edge(self, x_j, edge_attr):
edge_attr, idx = tf.unique(edge_attr)
matrix = tf.gather(self.matrix, edge_attr)
matrix = tf.gather(matrix, idx)
matrix = tf.reshape(matrix, [-1, self.dim, self.fea_dim])
x_j = tf.expand_dims(x_j, -1)
res = tf.matmul(matrix, x_j)
return tf.reshape(res, [-1, self.dim])

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading relation_conv.py and the apply_edge function, then trace how edge_attr and self.matrix are defined and populated. Check the surrounding graph-convolution code to determine what the tf.gather calls select and how the reshaped matrix is used. Done means documenting the purpose of the equation and why edge_attr indexes self.matrix.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.