Skip to content

Commit

Permalink
fix test sgNegative
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhvachher committed Mar 22, 2017
1 parent 659c1da commit 0532229
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gensim/test/test_word2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def testTrainingSgNegative(self):
"""Test skip-gram (negative sampling) word2vec training."""
# to test training, make the corpus larger by repeating its sentences over and over
# build vocabulary, don't train yet
model = word2vec.Word2Vec(size=2, min_count=1, hs=0, negative=2)
model = word2vec.Word2Vec(size=2, min_count=1, sg=1, hs=0, negative=2)
model.build_vocab(sentences)
self.assertTrue(model.wv.syn0.shape == (len(model.wv.vocab), 2))
self.assertTrue(model.syn1neg.shape == (len(model.wv.vocab), 2))
Expand All @@ -651,7 +651,7 @@ def testTrainingSgNegative(self):
self.assertEqual(sims, sims2)

# build vocab and train in one step; must be the same as above
model2 = word2vec.Word2Vec(sentences, size=2, min_count=1, hs=0, negative=2)
model2 = word2vec.Word2Vec(sentences, size=2, min_count=1, sg=1, hs=0, negative=2)
self.models_equal(model, model2)

def testTrainingCbowNegative(self):
Expand Down

0 comments on commit 0532229

Please sign in to comment.