tkipf / pygcn

Graph Convolutional Networks in PyTorch
MIT License
5.17k stars 1.23k forks source link

How to implement residual connections in gcn? #36

Open ray075hl opened 5 years ago

ray075hl commented 5 years ago

Hi @tkipf . I have some confusion about residual connection in GCN.

def forward(self, x, adj):
        # x size: [2708, 1433]
        # adj size: [2708, 2708]
        x = F.relu(self.gc1(x, adj))   # [2708, 16]
        ......

input size: [2708, 1433] , but first layer output's size is [2708, 16]

image If I implement residual like equation above.

x = F.relu(self.gc1(x, adj))  + x   

Error! size miss match.

wutaiqiang commented 4 years ago

the output of layer 'self.gc1()' is [*,16] what ever the input is

ray075hl commented 4 years ago

@wutaiqiang so, how to implement residual connection, when inputs feature dimension[, 1433] not equal to self.gc1() output size [, 16] ?