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

Method augment

GCL/augmentors/markov_diffusion.py:16–27  ·  view source on GitHub ↗
(self, g: Graph)

Source from the content-addressed store, hash-verified

14 self.add_self_loop = add_self_loop
15
16 def augment(self, g: Graph) -> Graph:
17 if self._cache is not None and self.use_cache:
18 return self._cache
19 x, edge_index, edge_weights = g.unfold()
20 edge_index, edge_weights = compute_markov_diffusion(
21 edge_index, edge_weights,
22 alpha=self.alpha, degree=self.order,
23 sp_eps=self.sp_eps, add_self_loop=self.add_self_loop
24 )
25 res = Graph(x=x, edge_index=edge_index, edge_weights=edge_weights)
26 self._cache = res
27 return res

Callers

nothing calls this directly

Calls 3

compute_markov_diffusionFunction · 0.90
GraphClass · 0.90
unfoldMethod · 0.80

Tested by

no test coverage detected