Skip to content

Commit

Permalink
Explicit epochs and corpus size in word2vec train(). Continuing #1139.
Browse files Browse the repository at this point in the history
…Fix #1052. (#1237)

* fix the compatibility between python2 & 3

* require explicit corpus size, epochs for train()

* make all train() calls use explicit count, epochs

* add tests to make sure that ValueError is indeed thrown

* update test

* fix the word2vec's reset_from()

* require explicit corpus size, epochs for train()

* make all train() calls use explicit count, epochs

* fix some error

* fix test error
  • Loading branch information
robotcator authored and tmylk committed Mar 30, 2017
1 parent 99151db commit becc6d3
Show file tree
Hide file tree
Showing 9 changed files with 543 additions and 178 deletions.
2 changes: 1 addition & 1 deletion docs/notebooks/doc2vec-IMDB.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@
" duration = 'na'\n",
" train_model.alpha, train_model.min_alpha = alpha, alpha\n",
" with elapsed_timer() as elapsed:\n",
" train_model.train(doc_list)\n",
" train_model.train(doc_list, total_examples=train_model.corpus_count, epochs=train_model.iter)\n",
" duration = '%.1f' % elapsed()\n",
" \n",
" # evaluate\n",
Expand Down
Loading

0 comments on commit becc6d3

Please sign in to comment.