|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.knowceans.dirichlet.lda.LdaGibbsSampler org.knowceans.dirichlet.atm.AtmGibbsSampler org.knowceans.dirichlet.atm.AtmGibbsQuerySampler
public class AtmGibbsQuerySampler
AtmGibbsQuerySampler allows sampling from known markov states, i.e., the model of an author-corpus, which can be used to predict the topics of query documents.
Field Summary | |
---|---|
(package private) AtmMarkovState |
atmstateq
stateq contains the query documents. |
private static long |
serialVersionUID
|
(package private) AtmMarkovState |
stateSave
stateSave contains the saved markov state (after initially loading the state. |
private double[][] |
thetasumq
|
Fields inherited from class org.knowceans.dirichlet.atm.AtmGibbsSampler |
---|
atmstate |
Fields inherited from class org.knowceans.dirichlet.lda.LdaGibbsSampler |
---|
backupIteration, conf, dispcol, numstats, phisum, rand, state, thetasum |
Constructor Summary | |
---|---|
AtmGibbsQuerySampler(AtmMarkovState state,
ExtLdaConfiguration conf,
java.util.Random rand,
boolean restorable)
Initialise the gibbs sampler with a known markov state (for querying). |
Method Summary | |
---|---|
double[][] |
getPredictiveTheta()
Get the document--topic associations of the query documents. |
double[][] |
getSavedPhi()
Get the backed up phi (without influence of the queries). |
protected void |
gibbs()
Main method: Select initial state ? |
private void |
initialState(boolean restorable)
Initialisation: initialise the sampler from a known state of the markov chain for querying the model. |
double[] |
query(int[] document)
Initialise the sampler with a one-document query. |
double[][] |
query(int[][] query)
Initialise the gibbs sampler with the query documents |
void |
restore()
For restorable state operation, restore (reinitialise) the state to that of the markov chain at object creation time. |
protected void |
updateTheta()
Add to the statistics the values of theta for the current state. |
Methods inherited from class org.knowceans.dirichlet.atm.AtmGibbsSampler |
---|
getState, gibbsAtm, gibbsAtmHeap, gibbsAtmHeap, initialState, main, run, sampleAtmFullConditional, sampleCorpus, saveState |
Methods inherited from class org.knowceans.dirichlet.lda.LdaGibbsSampler |
---|
getPhi, getTheta, gibbs, gibbsHeap, gibbsHeap, load, output, sampleCorpus, sampleLdaFullConditional, save, updateParams, updatePhi, writeParameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
AtmMarkovState atmstateq
AtmMarkovState stateSave
private double[][] thetasumq
Constructor Detail |
---|
public AtmGibbsQuerySampler(AtmMarkovState state, ExtLdaConfiguration conf, java.util.Random rand, boolean restorable)
state
- conf
- rand
- restorable
- whether the initial markov state can be restored using
restore (see there).Method Detail |
---|
private void initialState(boolean restorable)
restorable
- whether the initial markov state can be restored using
restore (see there).public double[] query(int[] document)
document
-
public double[][] query(int[][] query)
query
- word vectors
public void restore()
Because the association counts are influenced by the queries, the original state of the markov chain becomes "dirty". Therefore, this state can be backed up by enabling the argument restorable in the constructors.
protected void updateTheta()
updateTheta
in class LdaGibbsSampler
public double[][] getPredictiveTheta()
public double[][] getSavedPhi()
protected void gibbs()
AtmGibbsSampler
gibbs
in class AtmGibbsSampler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |