Skip to content

Commit

Permalink
Add unused args of _update_alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
lunastera committed Sep 2, 2020
1 parent e9bb3a7 commit 320cacd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gensim/models/word2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ def _job_producer(self, data_iterator, job_queue, cur_epoch=0, total_examples=No
# words-based decay
pushed_words += self._raw_word_count(job_batch)
epoch_progress = 1.0 * pushed_words / total_words
next_alpha = self._update_alpha(epoch_progress, cur_epoch)
next_alpha = self._update_alpha(next_alpha, epoch_progress, cur_epoch)

# add the sentence that didn't fit as the first item of a new job
job_batch, batch_size = [data], data_length
Expand Down Expand Up @@ -1359,11 +1359,13 @@ def _get_current_alpha(self, cur_epoch):
alpha = self.alpha - ((self.alpha - self.min_alpha) * float(cur_epoch) / self.epochs)
return alpha

def _update_alpha(self, epoch_progress, cur_epoch):
def _update_alpha(self, alpha, epoch_progress, cur_epoch):
"""Get the correct learning rate for the next iteration.
Parameters
----------
alpha : float
UNUSED.
epoch_progress : float
Ratio of finished work in the current epoch.
cur_epoch : int
Expand Down

0 comments on commit 320cacd

Please sign in to comment.