I notice that in the forward methods of models.py, the node and edge updates are written as:
# Inside forward methods of GINe, GATe , and PNA
# Pay attention to the `edge_attr` line
for i in range(self.num_gnn_layers):
x = (x + F.relu(self.batch_norms[i](self.convs[i](x, edge_index, edge_attr)))) / 2
if self.edge_updates:
edge_attr = edge_attr + self.emlps[i](torch.cat([x[src], x[dst], edge_attr], dim=-1)) / 2
As I understand, without /2 then the features update with a residual design. Using /2 to make an average is also ok since we don't have deep GNN here.
However, it is confusing that x is updated with average while edge_attr is not.
Also, the forward method of RGCN updates both x and edge_attr with /2:
# Inside forward methods of RGCN
# Pay attention to the `edge_attr` line
for i in range(self.num_gnn_layers):
x = (x + F.relu(self.batch_norms[i](self.convs[i](x, edge_index, edge_attr)))) / 2
if self.edge_updates:
edge_attr = (edge_attr + self.emlps[i](torch.cat([x[src], x[dst], edge_attr], dim=-1)))/ 2
Is this an intentional design?
I notice that in the
forwardmethods ofmodels.py, the node and edge updates are written as:As I understand, without
/2then the features update with a residual design. Using/2to make an average is also ok since we don't have deep GNN here.However, it is confusing that
xis updated with average whileedge_attris not.Also, the forward method of RGCN updates both
xandedge_attrwith/2:Is this an intentional design?