Closed wlgcqh closed 9 months ago
Thanks for your interest. You are right, the forward function should be x * (1 + ε)
according to the mathematic definition. Here we use the expression x * self.eps
because we add selfloop for each molecular graph during pre-processing. For example, in line 390 of chem/dataloader.py
:
edge_index, _ = add_self_loops(batch.edge_index, num_nodes = batch.x.size(0))
#add features corresponding to self-loop edges.
self_loop_attr = torch.zeros(batch.x.size(0), 2, dtype=torch.long)
self_loop_attr[:,0] = 4 #bond type for self-loop edge
edge_attr = torch.cat((batch.edge_attr, self_loop_attr), dim = 0)
batch.edge_index = edge_index
batch.edge_attr = edge_attr
`class NonParaGINConv(MessagePassing):
non-parametric gin
In the definition of GIN, the forward function should be
self.propagate(edge_index, x=x) + x * (1 + self.eps)