Reputation: 167
In this page (http://deeplearning4j.org/docs/latest/deeplearning4j-nlp-word2vec), this snippet of code is mentioned
log.info("Building model....");
Word2Vec vec = new Word2Vec.Builder()
.minWordFrequency(5)
.layerSize(100)
.seed(42)
.windowSize(5)
.iterate(iter)
.tokenizerFactory(t)
.build();
log.info("Fitting Word2Vec model....");
vec.fit();
What does .seed(42)
represent? It is not mentioned in the documentation.
The javadoc states This method defines random seed for random numbers generator
, but that does not help me understand how this value affects the random numbers generator
Upvotes: 0
Views: 148
Reputation: 336
That’s not specific to DL4j - seed defines initial state of random numbers generator, so sequence generated by this generator will be the same every time you try. So, initial weights of your model will be the same.
Upvotes: 0