Skip to content

Commit

Permalink
Merge pull request #154 from jamesvrt/fix/153-glee-seed
Browse files Browse the repository at this point in the history
Fix: correctly seed GLEE
  • Loading branch information
LucaCappelletti94 committed Feb 22, 2024
2 parents 8069487 + 672194a commit 62ba66f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class GLEE(Estimator):
"""

def __init__(self, dimensions: int = 128, seed: int = 42):

self.dimensions = dimensions
self.seed = seed

Expand All @@ -31,8 +30,9 @@ def fit(self, graph: nx.classes.graph.Graph):
graph = self._check_graph(graph)
number_of_nodes = graph.number_of_nodes()
L_tilde = nx.normalized_laplacian_matrix(graph, nodelist=range(number_of_nodes))
v0 = np.random.rand(min(L_tilde.shape))
_, self._embedding = sps.linalg.eigsh(
L_tilde, k=self.dimensions + 1, which="LM", return_eigenvectors=True
L_tilde, k=self.dimensions + 1, v0=v0, which="LM", return_eigenvectors=True
)

def get_embedding(self) -> np.array:
Expand Down

0 comments on commit 62ba66f

Please sign in to comment.