org.knowceans.topics.cgen
Class Pam5pGibbsSampler

java.lang.Object
  extended by org.knowceans.topics.cgen.Pam5pGibbsSampler

public class Pam5pGibbsSampler
extends java.lang.Object

Generated Gibbs sampler for the PAM5 model. 5-level pachinko allocation model, which extends the basic 4-level model by an additional hierarchy level. Testing C1B structures and hyperparameter grouping.

Implementation using parallelised samplers.

Mixture network specification:

 m >> (theta[m] | alpha) >> x[m][n]
 m, x[m][n] >> (thetax[m,x] | gamma[x]) >> y[m][n]
 m, y[m][n] >> (thetay[m,y] | delta[y]) >> z[m][n]
 z[m][n] >> (phi[z] | beta) >> w[m][n]
 
 
 elements:
 
    document m
    type: {ROOT|E3COUPLED}
    parents: (root)
    children: theta thetax thetay
    range: M
 ----
    topic-topic (thetay[m,y] | delta[y])
    type: {SEQUENCE|C1BSEQADD}
    parents: m y
    children: z
    components: thetay, domain: M *  L, range: J
    counts: nmyz, sum: nmyzsum
    index: my, selector: m,y
    hyperparams: delta, dimension: L * J, selector: y, fixed: false 
 ----
    topic z[m][n]
    type: {HIDDEN|E1SINGLE}
    parents: thetay
    children: phi
    range: J
 ----
    topic-word (phi[z] | beta)
    type: {TOPIC|C1ASINGLE}
    parents: z
    children: w
    components: phi, domain: J, range: V
    counts: nzw, sum: nzwsum
    index: z, selector: null
    hyperparams: beta, dimension 1, fixed: false 
 ----
    word w[m][n]
    type: {VISIBLE|E1SINGLE}
    parents: phi
    children: (leaf)
    range: V
 ----
    topic-topic (thetax[m,x] | gamma[x])
    type: {SEQUENCE|C1BSEQADD}
    parents: m x
    children: y
    components: thetax, domain: M *  K, range: L
    counts: nmxy, sum: nmxysum
    index: mx, selector: m,x
    hyperparams: gamma, dimension: K * L, selector: x, fixed: false 
 ----
    topic y[m][n]
    type: {HIDDEN|E1SINGLE}
    parents: thetax
    children: thetay
    range: L
 ----
    doc-topic (theta[m] | alpha)
    type: {SEQUENCE|C1ROOT}
    parents: m
    children: x
    components: theta, domain: M, range: K
    counts: nmx, sum: null
    index: m, selector: null
    hyperparams: alpha, dimension 1, fixed: false 
 ----
    topic x[m][n]
    type: {HIDDEN|E1SINGLE}
    parents: theta
    children: thetax
    range: K
 ----
 sequences:
 
 words [m][n]
 parent: (root), children: []
 edges: m x y z w
 

Author:
gregor heinrich (via MixNetKernelGenerator)

Field Summary
(package private)  double alpha
           
(package private)  double alphasum
           
(package private)  double beta
           
(package private)  double betasum
           
(package private)  double[][] delta
           
(package private)  double[] deltasum
           
(package private)  double[][] gamma
           
(package private)  double[] gammasum
           
(package private)  int iter
           
(package private)  int J
           
(package private)  int K
           
(package private)  int L
           
(package private)  int M
           
(package private)  int Mq
           
(package private)  int niter
           
(package private)  int[][] nmx
           
(package private)  int[][] nmxq
           
(package private)  int[][] nmxy
           
(package private)  int[][] nmxyq
           
(package private)  int[] nmxysum
           
(package private)  int[] nmxysumq
           
(package private)  int[][] nmyz
           
(package private)  int[][] nmyzq
           
(package private)  int[] nmyzsum
           
(package private)  int[] nmyzsumq
           
(package private)  int[][] nzw
           
(package private)  int[] nzwsum
           
(package private)  int P
           
(package private)  double[][] phi
           
(package private)  double[][][][] pp
           
(package private)  java.util.Random[] rand
           
(package private)  int V
           
(package private)  int[][] w
           
(package private)  int W
           
(package private)  int[][] wq
           
(package private)  int Wq
           
(package private)  int[][] x
           
(package private)  int[][] xq
           
(package private)  int[][] y
           
(package private)  int[][] yq
           
(package private)  int[][] z
           
(package private)  int[][] zq
           
 
Constructor Summary
Pam5pGibbsSampler(double delta, int J, double beta, int[][] w, int[][] wq, int V, double gamma, int L, double alpha, int K, java.util.Random rand)
           
 
Method Summary
 void estAlpha()
           
 void init()
           
 void initq()
           
static void main(java.lang.String[] args)
           
 double ppx()
           
 void run(int niter)
           
 void runq(int niterq)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rand

java.util.Random[] rand

iter

int iter

niter

int niter

M

int M

Mq

int Mq

nmyz

int[][] nmyz

nmyzq

int[][] nmyzq

nmyzsum

int[] nmyzsum

nmyzsumq

int[] nmyzsumq

delta

double[][] delta

deltasum

double[] deltasum

z

int[][] z

zq

int[][] zq

J

int J

nzw

int[][] nzw

nzwsum

int[] nzwsum

beta

double beta

betasum

double betasum

phi

double[][] phi

w

int[][] w

wq

int[][] wq

V

int V

nmxy

int[][] nmxy

nmxyq

int[][] nmxyq

nmxysum

int[] nmxysum

nmxysumq

int[] nmxysumq

gamma

double[][] gamma

gammasum

double[] gammasum

y

int[][] y

yq

int[][] yq

L

int L

nmx

int[][] nmx

nmxq

int[][] nmxq

alpha

double alpha

alphasum

double alphasum

x

int[][] x

xq

int[][] xq

K

int K

W

int W

Wq

int Wq

pp

double[][][][] pp

P

int P
Constructor Detail

Pam5pGibbsSampler

public Pam5pGibbsSampler(double delta,
                         int J,
                         double beta,
                         int[][] w,
                         int[][] wq,
                         int V,
                         double gamma,
                         int L,
                         double alpha,
                         int K,
                         java.util.Random rand)
Method Detail

main

public static void main(java.lang.String[] args)

init

public void init()

initq

public void initq()

run

public void run(int niter)

runq

public void runq(int niterq)

estAlpha

public void estAlpha()

ppx

public double ppx()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object