Skip to content

Commit

Permalink
Update core.py
Browse files Browse the repository at this point in the history
Redundant arithmetic fix
  • Loading branch information
KirillErofeev authored Aug 31, 2020
1 parent 8b93d75 commit 4257a38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions svd2vec/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ def subsampling(self):
if self.terms_counts[word] < self.min_count:
continue
word_frequency = 1.0 * self.terms_counts[word] / self.d_size
prob = 1 - np.sqrt(self.sub_threshold / word_frequency)
if not Utils.random_decision(prob):
prob = np.sqrt(self.sub_threshold / word_frequency)
if Utils.random_decision(prob):
# we keep the word
new_words.append(word)
new_docs.append(new_words)
Expand Down

0 comments on commit 4257a38

Please sign in to comment.