Rajat Mehta
2018-10-30 14:45:06 UTC
After spending days I am still not able to figure out how to automate the
hyperparameter tuning process of doc2vec. It would be really helpful for me
if someone who has implemented something similar can share some thoughts or
show a code snippet of how to implement GridSearchCV or any other
hyperparameter tuning process.
Here's how I am training my doc2vec model :
def train_doc2vec(
self,
X: List[List[str]],
epochs: int=10,
learning_rate: float=0.0002) -> gensim.models.doc2vec:
tagged_documents = list()
for idx, w in enumerate(X):
td = TaggedDocument(to_unicode(str.encode(' '.join(w))).split(), [str(idx)])
tagged_documents.append(td)
model = Doc2Vec(**self.params_doc2vec)
model.build_vocab(tagged_documents)
model.train(tagged_documents,
total_examples=model.corpus_count,
epochs=model.epochs)
return model
Best Regards,
Rajat
hyperparameter tuning process of doc2vec. It would be really helpful for me
if someone who has implemented something similar can share some thoughts or
show a code snippet of how to implement GridSearchCV or any other
hyperparameter tuning process.
Here's how I am training my doc2vec model :
def train_doc2vec(
self,
X: List[List[str]],
epochs: int=10,
learning_rate: float=0.0002) -> gensim.models.doc2vec:
tagged_documents = list()
for idx, w in enumerate(X):
td = TaggedDocument(to_unicode(str.encode(' '.join(w))).split(), [str(idx)])
tagged_documents.append(td)
model = Doc2Vec(**self.params_doc2vec)
model.build_vocab(tagged_documents)
model.train(tagged_documents,
total_examples=model.corpus_count,
epochs=model.epochs)
return model
Best Regards,
Rajat
--
You received this message because you are subscribed to the Google Groups "Gensim" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gensim+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Gensim" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gensim+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.