edge_index = add_self_loops(edge_index, x.size(0)) # 2 x (E+N) Here, it usesedge_indexto represent theAdjacency matrix 3. Compute normalization ( D^(-0.5) A D^(-0.5) ) edge_weight = torch.ones((edge_index.size(1),), dtype=x.dtype, device=edge_index.device) # [E+N] r...
l = [] for i in range(batch_size): l.append(Data(x=x[i], edge_index=self.edge_index)) batch = Batch.from_data_list(l).to(device) x = F.relu(self.conv1(x=batch.x, edge_index=batch.edge_index)) x, edge_index, _, batch, perm, score = self.pool1(x, batch.edge_index...
edge_index, edge_weight = add_remaining_self_loops(edge_index, edge_weight, 1, x.size(0)) # 2 x (E+N), [E+N] 2.1 Add node's self infomation (value=0) to edge_attr self_loop_edges = torch.zeros(x.size(0), edge_attr.size(1)).to(edge_index.device) # N x edge_dim edg...