org.knowceans.topics.cgen
Class Ldae3GibbsSampler
java.lang.Object
org.knowceans.topics.cgen.Ldae3GibbsSampler
public class Ldae3GibbsSampler
- extends java.lang.Object
Generated Gibbs sampler for the LDAE3 model. LDA with E3 structure Compiles
and runs ok.
Mixture network specification:
m >> (theta[m] | alpha) >> z[m][n]
z[m][n] >> (phi[z] | beta) >> w[m][n]
z[m][n] >> (psi[k] | gamma) >> w2[m][n]
k: { k = z + 10; if (k >= K) k = K - 1;
}.
elements:
document m
type: {ROOT|E1SINGLE}
parents: (root)
children: theta
range: M
----
doc-topic (theta[m] | alpha)
type: {SEQUENCE|C1ROOT}
parents: m
children: z
components: theta, domain: M, range: K
counts: nmz, sum: null
index: m, selector: null
hyperparams: alpha, dimension 1, fixed: false
----
topic z[m][n]
type: {HIDDEN|E3COUPLED}
parents: theta
children: phi psi
range: K
----
topic-word2 (psi[k] | gamma)
type: {TOPIC|C1ASINGLE}
parents: z
children: w2
components: psi, domain: K, range: V
counts: nkw2, sum: nkw2sum
index: k, selector: k = z + 10; if (k >= K) k = K - 1;
hyperparams: gamma, dimension 1, fixed: false
----
word2 w2[m][n]
type: {VISIBLE|E1SINGLE}
parents: psi
children: (leaf)
range: V
----
topic-word (phi[z] | beta)
type: {TOPIC|C1ASINGLE}
parents: z
children: w
components: phi, domain: K, 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
----
sequences:
words [m][n]
parent: (root), children: []
edges: m z w w2
- 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 |
gamma
|
(package private) double |
gammasum
|
(package private) int |
iter
|
(package private) int |
K
|
(package private) int |
M
|
(package private) int |
Mq
|
(package private) int |
niter
|
(package private) int[][] |
nkw2
|
(package private) int[] |
nkw2sum
|
(package private) int[][] |
nmz
|
(package private) int[][] |
nmzq
|
(package private) int[][] |
nzw
|
(package private) int[] |
nzwsum
|
(package private) double[][] |
phi
|
(package private) double[] |
pp
|
(package private) double[][] |
psi
|
(package private) java.util.Random |
rand
|
(package private) int |
V
|
(package private) int[][] |
w
|
(package private) int |
W
|
(package private) int[][] |
w2
|
(package private) int[][] |
w2q
|
(package private) int[][] |
wq
|
(package private) int |
Wq
|
(package private) int[][] |
z
|
(package private) int[][] |
zq
|
Constructor Summary |
Ldae3GibbsSampler(double alpha,
int K,
double gamma,
int[][] w2,
int[][] w2q,
int V,
double beta,
int[][] w,
int[][] wq,
java.util.Random rand)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
rand
java.util.Random rand
iter
int iter
niter
int niter
M
int M
Mq
int Mq
nmz
int[][] nmz
nmzq
int[][] nmzq
alpha
double alpha
alphasum
double alphasum
z
int[][] z
zq
int[][] zq
K
int K
nkw2
int[][] nkw2
nkw2sum
int[] nkw2sum
gamma
double gamma
gammasum
double gammasum
psi
double[][] psi
w2
int[][] w2
w2q
int[][] w2q
V
int V
nzw
int[][] nzw
nzwsum
int[] nzwsum
beta
double beta
betasum
double betasum
phi
double[][] phi
w
int[][] w
wq
int[][] wq
W
int W
Wq
int Wq
pp
double[] pp
Ldae3GibbsSampler
public Ldae3GibbsSampler(double alpha,
int K,
double gamma,
int[][] w2,
int[][] w2q,
int V,
double beta,
int[][] w,
int[][] wq,
java.util.Random rand)
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