MCPcopy
hub / github.com/dmlc/dgl / process

Method process

python/dgl/data/sbm.py:130–149  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

128 )
129
130 def process(self):
131 pq = self._pq
132 if type(pq) is list:
133 assert len(pq) == self._n_graphs
134 elif type(pq) is str:
135 generator = {"Appendix_C": self._appendix_c}[pq]
136 pq = [generator() for _ in range(self._n_graphs)]
137 else:
138 raise RuntimeError()
139 self._graphs = [
140 from_scipy(sbm(self._n_communities, self._block_size, *x))
141 for x in pq
142 ]
143 self._line_graphs = [
144 g.line_graph(backtracking=False) for g in self._graphs
145 ]
146 in_degrees = lambda g: g.in_degrees().float()
147 self._graph_degrees = [in_degrees(g) for g in self._graphs]
148 self._line_graph_degrees = [in_degrees(lg) for lg in self._line_graphs]
149 self._pm_pds = list(zip(*[g.edges() for g in self._graphs]))[0]
150
151 @property
152 def graph_path(self):

Callers

nothing calls this directly

Calls 7

from_scipyFunction · 0.85
sbmFunction · 0.85
in_degreesFunction · 0.85
line_graphMethod · 0.80
floatMethod · 0.45
in_degreesMethod · 0.45
edgesMethod · 0.45

Tested by

no test coverage detected