Pinsage get_repr function

Why does the get_repr function only projects the first subgraph’s source nodes and last subgraphs destination nodes here?


    def get_repr(self, blocks):

        h_item = self.proj(blocks[0].srcdata)

        h_item_dst = self.proj(blocks[-1].dstdata)
        return h_item_dst + self.sage(blocks, h_item)

PinSAGE only computes representations of items in the get_repr function. The last block’s destination nodes are the items which we want to compute representations in this minibatch, while the first block’s source nodes are the items which we need to compute the GNN representations with self.sage.

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