MCPcopy Create free account
hub / github.com/NineAbyss/ZeroG / forward

Method forward

code/model.py:82–99  ·  view source on GitHub ↗
(self, x, edge_index, edge_weight=None, batch=None)

Source from the content-addressed store, hash-verified

80 self.norms.append(obtain_norm(self.norm)(self.emb_dim[i + 1]))
81
82 def forward(self, x, edge_index, edge_weight=None, batch=None):
83
84 xs = []
85 for i in range(self.num_layer):
86 x = self.encs[i](x, edge_index, edge_weight)
87 x = self.norms[i](x) if self.norm else x
88 x = F.dropout(self.acts[i](x), self.drop_ratio, training=self.training)
89 xs.append(x)
90
91 if batch is not None:
92 xs = [global_add_pool(x, batch) for x in xs]
93
94 if self.concat:
95 x = torch.concat(xs, dim=1)
96 else:
97 x = xs[-1]
98
99 return x
100
101
102class GraphCL(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected