-
Notifications
You must be signed in to change notification settings - Fork 49
[Possible Bug?] Inconsistency of Feature Update in models.py #8
Copy link
Copy link
Open
Description
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)) / 2As 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)))/ 2Is this an intentional design?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels