-
-
Save BernardOng/5c004ba303dedcfb8afbc49f8b5f8b35 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [Doc2Vec Parameters] | |
vec_dim = 30 | |
win_size = 1 | |
alpha = 0.01 | |
np.random.seed(381888) | |
min_count = 2 | |
sample = 1e-5 | |
workers = 100 | |
epochs = 10 | |
# build | |
model = Doc2Vec(size=int(vec_dim), window=win_size, alpha=alpha, min_count=min_count, sample=sample, workers=workers) | |
model.build_vocab(tList.toArray()) | |
tmpList = tList.toArray() | |
print 'Training Model...' | |
for e in range(epochs): | |
print '\tEpoch ' + str(e) | |
random.shuffle(tmpList) | |
model.alpha -= 0.001 | |
model.min_alpha = model.alpha |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment