(self, inputs, adj)
| 32 | self.device = device |
| 33 | |
| 34 | def forward(self, inputs, adj): |
| 35 | x = inputs |
| 36 | x = self.dropout(x) |
| 37 | node_size = adj.size(0) |
| 38 | I = torch.eye(node_size, requires_grad=False).to(self.device) |
| 39 | adj = adj + I |
| 40 | D = torch.diag(torch.sum(adj, dim=1, keepdim=False)) |
| 41 | adj = torch.matmul(torch.inverse(D), adj) |
| 42 | pre_sup = torch.matmul(x, self.W) |
| 43 | output = torch.matmul(adj, pre_sup) |
| 44 | |
| 45 | if self.bias: |
| 46 | output += self.b |
| 47 | if self.active_function is not None: |
| 48 | return self.active_function(output) |
| 49 | else: |
| 50 | return output |
| 51 | |
| 52 | |
| 53 |
nothing calls this directly
no outgoing calls
no test coverage detected