Batched GCN Example - Add dropout, edge features


How can I add dropout to the example (

I know how to add edge features, but I was wondering how I would design the message passing to not only include the average of node features but also the average of edge features? or some learned weighting of both types in the example ( given?




By “add dropout”, if you are referring to performing dropout on node features, simply do the modification below:

class GCN(nn.Module):
    def __init__(self, in_feats, out_feats, activation, dropout_rate):
        super(GCN, self).__init__()
        self.apply_mod = NodeApplyModule(in_feats, out_feats, activation)
        self.dropout = nn.Dropout(dropout_rate)

    def forward(self, g, feature):
        # Initialize the node features with h.
        feature = self.dropout(feature)
        g.ndata['h'] = feature
        g.update_all(msg, reduce)
        return g.ndata.pop('h')

For the second issue, you may find our tutorial on RGCN and a related discussion thread to be helpful.



It seems that the link has triggered the automatic spam detection by the system and I accidentally approved the spam flagging request. I haven’t figure out how to undo that and I’m sorry for it.