MCPcopy Create free account
hub / github.com/PyGCL/PyGCL / augment

Method augment

GCL/augmentors/ppr_diffusion.py:14–24  ·  view source on GitHub ↗
(self, g: Graph)

Source from the content-addressed store, hash-verified

12 self.add_self_loop = add_self_loop
13
14 def augment(self, g: Graph) -> Graph:
15 if self._cache is not None and self.use_cache:
16 return self._cache
17 x, edge_index, edge_weights = g.unfold()
18 edge_index, edge_weights = compute_ppr(
19 edge_index, edge_weights,
20 alpha=self.alpha, eps=self.eps, ignore_edge_attr=False, add_self_loop=self.add_self_loop
21 )
22 res = Graph(x=x, edge_index=edge_index, edge_weights=edge_weights)
23 self._cache = res
24 return res

Callers

nothing calls this directly

Calls 3

compute_pprFunction · 0.90
GraphClass · 0.90
unfoldMethod · 0.80

Tested by

no test coverage detected