From 8ba59c38c3a013b2135c3bf3d42e622b5fee0b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Milinovi=C4=87?= <44698587+imilinovic@users.noreply.github.com> Date: Fri, 9 Aug 2024 10:22:53 +0200 Subject: [PATCH] Node2vec - enforce that either negative_rate or hs are positive (#502) --- python/mage/node2vec_online_module/w2v_learners.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/mage/node2vec_online_module/w2v_learners.py b/python/mage/node2vec_online_module/w2v_learners.py index d41ecd926..586adcee3 100644 --- a/python/mage/node2vec_online_module/w2v_learners.py +++ b/python/mage/node2vec_online_module/w2v_learners.py @@ -48,7 +48,7 @@ def partial_fit(self, sentences: List[List[Any]]) -> None: "epochs": self.num_epochs, "workers": self.threads, } - if self.negative_rate < 0: + if self.negative_rate <= 0: self.negative_rate = 0 self.model = Word2Vec( sentences, negative=self.negative_rate, hs=1, **params