Multiply edge weight for each neighbor of target node

Hi, I am dealing with data which has both node features and edge feature.
unlike node features, each edge feature vector is 1-dimensional, like a weight, so I think I can multiply each neighbor node embeddings of the target node v with the respective edge feature vector. That means, multiplying the weight of edge(u, v) with node u’s embedding vector before aggregating the neighbors of node v(u in N(v)).

I was trying to implement this idea, but couldn’t find where to put it in the code. The base convnets I am using are sage and gin.

In the code of convnet, there is update_all function with message passing function and reduce function. I don’t know where to put the multiplying function.

The weight of each edge is not used as it is, need to handle it depending on the target node’s computational graph. So that I can’t use u_mul_e for message function.

The user-defined function for message passing function only passes corresponding edge features or node features, not both.

Should I use dgl.in_subgraph for each computation to get neighbor node ids? Then where to put this function? messege passing or reduce function?

Problem solved! Actually, I can access to dst, src, and graph features in a udf message function even when I am handling edges. So I sent both edge weights and nodes’ embedding vectors to my udf reduce function. And then I was able to do the additional process in the reduce function depending on each node’s computational graph.

2 Likes