MCPcopy
hub / github.com/THUDM/CogDL / mini_forward

Method mini_forward

examples/dgraph/models/graphsage.py:54–64  ·  view source on GitHub ↗
(self, graph)

Source from the content-addressed store, hash-verified

52 )
53
54 def mini_forward(self, graph):
55 x = graph.x
56 for i in range(self.num_layers):
57 edge_index_sp = self.sampling(graph.edge_index, self.sample_size[i]).to(x.device)
58 with graph.local_graph():
59 graph.edge_index = edge_index_sp
60 x = self.convs[i](graph, x)
61 if i != self.num_layers - 1:
62 x = F.relu(x)
63 x = F.dropout(x, p=self.dropout, training=self.training)
64 return x
65
66 def forward(self, *args):
67 if isinstance(args[0], Graph):

Callers 1

forwardMethod · 0.95

Calls 3

samplingMethod · 0.95
local_graphMethod · 0.80
toMethod · 0.45

Tested by

no test coverage detected