org.knowceans.dirichlet.atm
Class AtmMarkovState

java.lang.Object
  extended by org.knowceans.dirichlet.lda.LdaMarkovState
      extended by org.knowceans.dirichlet.atm.AtmMarkovState
All Implemented Interfaces:
java.io.Serializable

public class AtmMarkovState
extends LdaMarkovState

AtmMarkovState represents the state of the gibbs sampler of the lda process used for estimating unknown documents (word vectors).

Author:
gregor
See Also:
Serialized Form

Field Summary
 int A
          total number of authors
 int[][] ad
          document authors [M][]
private static long serialVersionUID
           
 int[][] x
          word authors
 
Fields inherited from class org.knowceans.dirichlet.lda.LdaMarkovState
nd, ndsum, nw, nwsum, V, w, z
 
Constructor Summary
AtmMarkovState()
          Initialise markov state for loading or setting by parameters (subclasses only).
AtmMarkovState(AtmMarkovState state)
          Copy constructor that copies all internal fields from state to this.
AtmMarkovState(int[][] w, int V, int[][] ad, int A, int[][] z, int K, int[][] x)
          Initialise the object from the data given.
AtmMarkovState(java.lang.String atmBase)
          Set up the markov chain from a file.
 
Method Summary
 void copyTo(AtmMarkovState cps)
          Copy the information contained in this to the fields of the argument object.
protected  void initNd(int M, int K, java.util.Random rand)
           
 void load(java.lang.String filename)
          Load state arrays from file.
 void recalculate(int[][] z, int[][] x)
          Recalculates the topic statistics from the word-topic associations.
 void save(java.lang.String filename)
          Save (optionally compressed) file.
 
Methods inherited from class org.knowceans.dirichlet.lda.LdaMarkovState
copyTo, init, initNw, recalculate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

ad

public int[][] ad
document authors [M][]


x

public int[][] x
word authors


A

public int A
total number of authors

Constructor Detail

AtmMarkovState

public AtmMarkovState()
Initialise markov state for loading or setting by parameters (subclasses only).


AtmMarkovState

public AtmMarkovState(java.lang.String atmBase)
Set up the markov chain from a file.

Parameters:
atmBase -

AtmMarkovState

public AtmMarkovState(AtmMarkovState state)
Copy constructor that copies all internal fields from state to this.

Parameters:
state -

AtmMarkovState

public AtmMarkovState(int[][] w,
                      int V,
                      int[][] ad,
                      int A,
                      int[][] z,
                      int K,
                      int[][] x)
Initialise the object from the data given.

Parameters:
w - document vectors
V - vocabulary size
ad - document authors
A - author community size
z - document word topics
K - topic count
x - document word authors
Method Detail

recalculate

public void recalculate(int[][] z,
                        int[][] x)
Recalculates the topic statistics from the word-topic associations.

Parameters:
z -
x -

copyTo

public void copyTo(AtmMarkovState cps)
Copy the information contained in this to the fields of the argument object.

Parameters:
cps -

load

public void load(java.lang.String filename)
Load state arrays from file.

Overrides:
load in class LdaMarkovState
Parameters:
file -

save

public void save(java.lang.String filename)
Save (optionally compressed) file.

Overrides:
save in class LdaMarkovState
Parameters:
file -

initNd

protected void initNd(int M,
                      int K,
                      java.util.Random rand)
Overrides:
initNd in class LdaMarkovState