Help on message passing

Hi Everyone,

I am new to the DGL lib and trying to follow some examples on the website. I am on the nn-foward module 3.2 DGL NN Module Forward Function — DGL 0.7.2 documentation One part of the example in the Message passing and reducing section got confused.

For the aggregation type != ‘gcn’, it has a variable named h_self, which supposed to be the hidden state of the node itself. The code above actually doesn’t define this variable, so I wonder what it’s value should really be.

Another question is, let’s take the example of the self._aggre_type == ‘mean’ in that snippet. If I want to do an edge weight weighted mean, what’s the most efficient way of writing it.

Thanks,
Michael

for h_self, please check the whole code in https://github.com/dmlc/dgl/blob/fa343873a87dadbc64f08f3b247f8be7fc9f94ff/python/dgl/nn/pytorch/conv/sageconv.py#L12

edge weight weighted mean? could you elaborate more on what you want? fn.copy_e is what you want? pls check here to see if any built-in function is what you want: dgl.function — DGL 0.7.2 documentation

1 Like

please refer to FAQ 11: How to perform message passing on weighted graphs?

1 Like

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