public InMemoryCollapsedVariationalBayes0(Matrix corpus, String[] terms, int numTopics, double alpha, double eta, int numTrainingThreads, int numUpdatingThreads, double modelCorpusFraction) { //this.seed = seed; this.numTopics = numTopics; this.alpha = alpha; this.eta = eta; //this.minDfCt = 0; //this.maxDfPct = 1.0f; corpusWeights = corpus; numDocuments = corpus.numRows(); this.terms = terms; this.initialModelCorpusFraction = modelCorpusFraction; numTerms = terms != null ? terms.length : corpus.numCols(); Map<String, Integer> termIdMap = Maps.newHashMap(); if (terms != null) { for (int t = 0; t < terms.length; t++) { termIdMap.put(terms[t], t); } } this.numTrainingThreads = numTrainingThreads; this.numUpdatingThreads = numUpdatingThreads; postInitCorpus(); initializeModel(); }
public InMemoryCollapsedVariationalBayes0(Matrix corpus, String[] terms, int numTopics, double alpha, double eta, int numTrainingThreads, int numUpdatingThreads, double modelCorpusFraction) { //this.seed = seed; this.numTopics = numTopics; this.alpha = alpha; this.eta = eta; //this.minDfCt = 0; //this.maxDfPct = 1.0f; corpusWeights = corpus; numDocuments = corpus.numRows(); this.terms = terms; this.initialModelCorpusFraction = modelCorpusFraction; numTerms = terms != null ? terms.length : corpus.numCols(); Map<String, Integer> termIdMap = Maps.newHashMap(); if (terms != null) { for (int t = 0; t < terms.length; t++) { termIdMap.put(terms[t], t); } } this.numTrainingThreads = numTrainingThreads; this.numUpdatingThreads = numUpdatingThreads; postInitCorpus(); initializeModel(); }
public InMemoryCollapsedVariationalBayes0(Matrix corpus, String[] terms, int numTopics, double alpha, double eta, int numTrainingThreads, int numUpdatingThreads, double modelCorpusFraction) { //this.seed = seed; this.numTopics = numTopics; this.alpha = alpha; this.eta = eta; //this.minDfCt = 0; //this.maxDfPct = 1.0f; corpusWeights = corpus; numDocuments = corpus.numRows(); this.terms = terms; this.initialModelCorpusFraction = modelCorpusFraction; numTerms = terms != null ? terms.length : corpus.numCols(); Map<String, Integer> termIdMap = new HashMap<>(); if (terms != null) { for (int t = 0; t < terms.length; t++) { termIdMap.put(terms[t], t); } } this.numTrainingThreads = numTrainingThreads; this.numUpdatingThreads = numUpdatingThreads; postInitCorpus(); initializeModel(); }