Feature Assignment in PinSage implementation

image

Hi,

This corresponds to sampler.py file in PinSage example

(dgl/sampler.py at master · dmlc/dgl · GitHub):

I am not able to understand why only dst_nodes are getting considered for assignment of features for blocks[-1]. Since features get aggregated, should we not use all the nodes that we get from src ?
For blocks[0], this looks okay.

Thanks
Nishant

Each graph in blocks is associated with a GNN layer. Basically, the representation on the source of blocks[0] will be aggregated with the first GNN layer into the destination of blocks[0], which in turn will be used for the source of blocks[1]. The process goes on until the last layer. So we only need to assign blocks[0].srcdata.

The reason to additionally assign to blocks[-1].dstdata is that, the architecture for our PinSage implementation is the aggregation of the neighborhood features (hence blocks[0].srcdata), plus an MLP of the nodes’ own features (hence blocks[-1].dstdata, since the destination nodes of blocks[-1] are identical to the seed nodes for sampling).

See dgl/model.py at master · dmlc/dgl · GitHub.

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