MCPcopy Index your code
hub / github.com/PyGCL/PyGCL / _eigenvector_centrality

Function _eigenvector_centrality

GCL/augmentors/functional.py:135–139  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

133
134def get_eigenvector_weights(data):
135 def _eigenvector_centrality(data):
136 graph = to_networkx(data)
137 x = nx.eigenvector_centrality_numpy(graph)
138 x = [x[i] for i in range(data.num_nodes)]
139 return torch.tensor(x, dtype=torch.float32).to(data.edge_index.device)
140
141 evc = _eigenvector_centrality(data)
142 scaled_evc = evc.where(evc > 0, torch.zeros_like(evc))

Callers 1

get_eigenvector_weightsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected