Skip to content

[Possible Bug?] Inconsistency of Feature Update in models.py #8

Description

@Linnore

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions