Skip to content

Commit

Permalink
chore: debugged feather
Browse files Browse the repository at this point in the history
  • Loading branch information
BenTenmann committed Aug 4, 2021
1 parent 01bbaee commit 8d60bca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions karateclub/graph_embedding/feathergraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ def _create_node_feature_matrix(self, graph: nx.classes.graph.Graph) -> np.ndarr
Return types:
* **X** *(NumPy array)* - The node features.
"""
self.n_nodes = graph.number_of_nodes()
self.degree_fn = _get_degree_fn(graph)

log_degree = np.array([math.log(self.degree_fn(node) + 1)
for node in range(self.n_nodes)])
log_degree = log_degree.reshape(-1, 1)
Expand All @@ -134,6 +131,9 @@ def _calculate_feather(self, graph: nx.classes.graph.Graph) -> np.ndarray:
Return types:
* **features** *(Numpy vector)* - The embedding of a single graph.
"""
self.n_nodes = graph.number_of_nodes()
self.degree_fn = _get_degree_fn(graph)

A_tilde = self._get_normalized_adjacency(graph)
X = self._create_node_feature_matrix(graph)
theta = np.linspace(0.01, self.theta_max, self.eval_points)
Expand Down

0 comments on commit 8d60bca

Please sign in to comment.