Fix SM Model Internal Reproducibility Bug (#34)

* Fix SM Model reproducibility bug

vocab is in different order every time, causing unseen words to use
different random states

* Make requirements.txt usable from conda and pip

The existing torch requirement does not work with conda or pip.
Also upgrade pytorch version while we are at it.
This commit is contained in:
Michael Tu
2017-07-20 06:52:26 +08:00
committed by Jimmy Lin
parent 061cc8dd09
commit a6fc10818f
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -2,4 +2,4 @@ gensim==1.0.1
nltk==3.2.1
numpy==1.11.3
pandas==0.19.2
torch==0.1.11+b13b701
pytorch==0.1.12
+1 -1
View File
@@ -155,7 +155,7 @@ def read_in_dataset(dataset_folder, set_folder, stop_punct=False, dash_split=Fal
for sentence in all_data:
for term in sentence.split():
vocab_set.add(term)
vocab = list(vocab_set)
vocab = sorted(list(vocab_set))
return [questions, sentences, labels, max(len_q_list), max(len_s_list), vocab]