How not to reduce edge features in 'update_all' function

Hi. I have a question about concatenating edge features to nodes when using the ‘update_all’ function.

In my understanding, the DGL provides ‘copy_e,’ which transfers edge features to nodes when using with ‘update_all’ function. And then, the ‘update_all’ function tries to reduce edge features (e.g., sum, max, min).
I want to concatenate edge features and save them into nodes as a new node feature. Is there a way not to reduce in ‘update_all’?

If you don’t reduce it I think the results will not have the same shapes for every node, since each node may have different in-degree. This will make computation difficult.

If you can make sure that every node indeed has the same degree, you could write a custom reduce function by stacking the incoming messages together. Also, using LSTM/DeepSets/etc. instead of simple sum/mean is also an option.
https://docs.dgl.ai/tutorials/blitz/3_message_passing.html#even-more-customization-by-user-defined-function

Dear @BarclayII

Thank you so much for your kind reply.
I will try to write a custom reduce function which can handle different in-degree of each node.

Sincerely,
SangHyuk Yoo

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.