MCPcopy Create free account
hub / github.com/TPCD/DCCL / forward

Method forward

model/meta_graph.py:34–50  ·  view source on GitHub ↗
(self, inputs, adj)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected