@Test(timeout = 300000) public void testDoubleFit() throws Exception { boolean isIntegration = isIntegrationTests(); File resource = Resources.asFile("/big/raw_sentences.txt"); SentenceIterator iter = getIterator(isIntegration, resource); TokenizerFactory t = new DefaultTokenizerFactory(); t.setTokenPreProcessor(new CommonPreprocessor()); LabelsSource source = new LabelsSource("DOC_"); val builder = new ParagraphVectors.Builder(); ParagraphVectors vec = builder.minWordFrequency(1).iterations(5).seed(119).epochs(1) .layerSize(150).learningRate(0.025).labelsSource(source).windowSize(5) .sequenceLearningAlgorithm(new DM<VocabWord>()).iterate(iter).trainWordVectors(true) .usePreciseWeightInit(true) .batchSize(8192) .allowParallelTokenization(false) .tokenizerFactory(t).workers(1).sampling(0).build(); vec.fit(); long num1 = vec.vocab().totalNumberOfDocs(); vec.fit(); System.out.println(vec.vocab().totalNumberOfDocs()); long num2 = vec.vocab().totalNumberOfDocs(); assertEquals(num1, num2); }
@Override public void fit() { super.fit(); extractLabels(); }
ParagraphVectors extends Word2Vec { @Override public void fit() { super.fit(); extractLabels(); } }
ParagraphVectors extends Word2Vec { @Override public void fit() { super.fit(); extractLabels(); } protected  ParagraphVectors(); }
ParagraphVectors extends Word2Vec { @Override public void fit() { super.fit(); extractLabels(); } protected  ParagraphVectors(); @Deprecated String predict(String rawText); void setSequenceIterator(@NonNull SequenceIterator<VocabWord> iterator); String predict(LabelledDocument document); void extractLabels(); INDArray inferVector(String text, double learningRate, double minLearningRate, int iterations); INDArray inferVector(LabelledDocument document, double learningRate, double minLearningRate,
                    int iterations); INDArray inferVector(@NonNull List<VocabWord> document, double learningRate, double minLearningRate,
                    int iterations); INDArray inferVector(String text); INDArray inferVector(LabelledDocument document); INDArray inferVector(@NonNull List<VocabWord> document); Future<Pair<String, INDArray>> inferVectorBatched(@NonNull LabelledDocument document); Future<INDArray> inferVectorBatched(@NonNull String document); List<INDArray> inferVectorBatched(@NonNull List<String> documents); String predict(List<VocabWord> document); Collection<String> predictSeveral(@NonNull LabelledDocument document, int limit); Collection<String> predictSeveral(String rawText, int limit); Collection<String> predictSeveral(List<VocabWord> document, int limit); Collection<String> nearestLabels(LabelledDocument document, int topN); Collection<String> nearestLabels(@NonNull String rawText, int topN); Collection<String> nearestLabels(@NonNull Collection<VocabWord> document, int topN); Collection<String> nearestLabels(INDArray labelVector, int topN); @Deprecated double similarityToLabel(String rawText, String label); @Override void fit(); double similarityToLabel(LabelledDocument document, String label); double similarityToLabel(List<VocabWord> document, String label); String toJson(); static ParagraphVectors fromJson(String jsonString); }
ParagraphVectors extends Word2Vec { @Override public void fit() { super.fit(); extractLabels(); } protected  ParagraphVectors(); @Deprecated String predict(String rawText); void setSequenceIterator(@NonNull SequenceIterator<VocabWord> iterator); String predict(LabelledDocument document); void extractLabels(); INDArray inferVector(String text, double learningRate, double minLearningRate, int iterations); INDArray inferVector(LabelledDocument document, double learningRate, double minLearningRate,
                    int iterations); INDArray inferVector(@NonNull List<VocabWord> document, double learningRate, double minLearningRate,
                    int iterations); INDArray inferVector(String text); INDArray inferVector(LabelledDocument document); INDArray inferVector(@NonNull List<VocabWord> document); Future<Pair<String, INDArray>> inferVectorBatched(@NonNull LabelledDocument document); Future<INDArray> inferVectorBatched(@NonNull String document); List<INDArray> inferVectorBatched(@NonNull List<String> documents); String predict(List<VocabWord> document); Collection<String> predictSeveral(@NonNull LabelledDocument document, int limit); Collection<String> predictSeveral(String rawText, int limit); Collection<String> predictSeveral(List<VocabWord> document, int limit); Collection<String> nearestLabels(LabelledDocument document, int topN); Collection<String> nearestLabels(@NonNull String rawText, int topN); Collection<String> nearestLabels(@NonNull Collection<VocabWord> document, int topN); Collection<String> nearestLabels(INDArray labelVector, int topN); @Deprecated double similarityToLabel(String rawText, String label); @Override void fit(); double similarityToLabel(LabelledDocument document, String label); double similarityToLabel(List<VocabWord> document, String label); String toJson(); static ParagraphVectors fromJson(String jsonString);  }