public final class OnlineLDAOptimizer extends java.lang.Object implements LDAOptimizer
An online optimizer for LDA. The Optimizer implements the Online variational Bayes LDA algorithm, which processes a subset of the corpus on each iteration, and updates the term-topic distribution adaptively.
Original Online LDA paper: Hoffman, Blei and Bach, "Online Learning for Latent Dirichlet Allocation." NIPS, 2010.
Constructor and Description |
---|
OnlineLDAOptimizer() |
Modifier and Type | Method and Description |
---|---|
double |
getKappa()
Learning rate: exponential decay rate
|
double |
getMiniBatchFraction()
Mini-batch fraction, which sets the fraction of document sampled and used in each iteration
|
boolean |
getOptimizeDocConcentration()
Optimize docConcentration, indicates whether docConcentration (Dirichlet parameter for
document-topic distribution) will be optimized during training.
|
double |
getTau0()
A (positive) learning parameter that downweights early iterations.
|
OnlineLDAOptimizer |
setKappa(double kappa)
Learning rate: exponential decay rate---should be between
(0.5, 1.0] to guarantee asymptotic convergence.
|
OnlineLDAOptimizer |
setMiniBatchFraction(double miniBatchFraction)
Mini-batch fraction in (0, 1], which sets the fraction of document sampled and used in
each iteration.
|
OnlineLDAOptimizer |
setOptimizeDocConcentration(boolean optimizeDocConcentration)
Sets whether to optimize docConcentration parameter during training.
|
OnlineLDAOptimizer |
setTau0(double tau0)
A (positive) learning parameter that downweights early iterations.
|
public double getTau0()
public OnlineLDAOptimizer setTau0(double tau0)
tau0
- (undocumented)public double getKappa()
public OnlineLDAOptimizer setKappa(double kappa)
kappa
- (undocumented)public double getMiniBatchFraction()
public OnlineLDAOptimizer setMiniBatchFraction(double miniBatchFraction)
Note that this should be adjusted in synch with LDA.setMaxIterations()
so the entire corpus is used. Specifically, set both so that
maxIterations * miniBatchFraction >= 1.
Default: 0.05, i.e., 5% of total documents.
miniBatchFraction
- (undocumented)public boolean getOptimizeDocConcentration()
public OnlineLDAOptimizer setOptimizeDocConcentration(boolean optimizeDocConcentration)
Default: false
optimizeDocConcentration
- (undocumented)