Open rongan-Arya opened 2 years ago
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])
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])