How to propagate edge features

I am new to dgl and after have read some models,I have a question:almost all the models do propagate the node feature through edges,which means nodes do send->receive->update,what we need to do is define different message、reduce and update func,but how to propagate edge features through nodes?
For example,in the reduce func,nodes can sum all the messages received by torch.sum(nodes.mailbox[]),but how a edge can sum all the messages it received from all adjacent edges.Here is my model:h_l = u(h_l,sum(m(h_l,h_k)) over all k) ,where k is the adjacent edge of edge l and m is the message func ,u denotes the update func.Thanks for any advice.

Hi @may5hap, I was wondering what do you mean by “adjacent edges”? Are two edges sharing the same source/destination nodes adjacent?

yeah,for example,graph g have 4 nodes(0,1,2,3) and 4 edges:0->1,1->2,2->3,1->3,the edge 0->1 have adjacent edges:1->2 and 1->3 ,the edge 2->3 has adjacent edges:1->2 and 1->3…In fact,the edges in my model are undirected.

Currently you can achieve edge propagation via:

  1. first propagate edge feature to nodes then propagate node feature to edges. (e.g. the edge_softmax module used in GAT model).
  2. use line_graph api to transform the graph so that adjacent edges would become adjacent nodes.