Skip to content

Commit

Permalink
Merge pull request valentinp72#2 from KirillErofeev/patch-1
Browse files Browse the repository at this point in the history
Redundant arithmetic in core.py
  • Loading branch information
valentinp72 authored Nov 29, 2020
2 parents 8b93d75 + 4257a38 commit c97998d
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 c97998d

Please sign in to comment.