|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.knowceans.topics.cgen.MixItem org.knowceans.topics.cgen.MixNode
public class MixNode
represents a mixture node.
TODO: this may be subclassed for node data types
Field Summary | |
---|---|
(package private) java.lang.String |
alpha
hyperparameter name |
static int |
C1ASINGLE
C1A single input, non-root edge (e.g., LDA: phi[k]) |
static int |
C1BSEQADD
C1B single input added sequence (e.g., PAM: theta[m,x]) |
static int |
C1INPUT
any C1 input |
static int |
C1ROOT
single input, root edge (e.g., LDA: theta[m]), Note: this is different from SEQUENCE, where a single C1 sequence input among many leads to the classification) |
static int |
C2MULTI
C2 multiple non-sequence input edges (w/kSel, e.g., Bi-LDA: phi[u,m]) |
static int |
C3MERGED
C3 merged component C3 (NOT using kSel, novel structure) |
static int |
C4SWITCH
C4 switched input C4 (using kSel, e.g., Multi-grain LDA) |
static int |
C5COUPLED
C5 coupled node C5 (using coupledNodes) |
static int |
C5MAIN
C5 main node: all parameters and hyperparameters in coupledNodes are deferred to this node |
(package private) java.lang.String |
constK
constant value for K |
(package private) MixNode |
coupledMainNode
main node in a coupled group |
(package private) java.util.List<MixNode> |
coupledNodes
nodes this shares parameters with (only one for now) |
(package private) int |
dimAlpha
dimension of alpha: 0..2 |
static int |
E2SPLIT
E2 multiple output sequences |
(package private) boolean |
fixedAlpha
don't estimate alpha |
static int |
HIDDEN
summarising hidden structures |
(package private) java.lang.String |
j
component group name |
java.lang.String |
J
component group index range (elements of alpha) |
(package private) java.lang.String |
jSel
component group selector (Java expression as in j = |
(package private) java.lang.String |
k
component name |
(package private) java.lang.String |
K
component count = domain (= range of kSel over all inputs) |
(package private) java.lang.String |
kSel
component selector (Java expression as in k = |
static int |
N6AGGREG
N6 aggregation node |
static java.util.List<MixEdge> |
NOEDGE
represents the empty edge set |
(package private) java.lang.String |
ntheta
count name |
(package private) java.lang.String |
nthetasum
sum count name |
static int |
SEQINPUT
any sequence input: state by no parameters at query-time |
static int |
SEQUENCE
sequence node (will generate query-time structure) |
(package private) boolean |
sparse
sparse representation of visible nodes: by a label sequence |
(package private) java.lang.String |
T
outgoing edge count = T of first edge |
(package private) java.lang.String |
theta
parameter name |
static int |
TOPIC
topic node (global scope) |
static int |
VISIBLE
is this node observed (set a priori) |
Fields inherited from class org.knowceans.topics.cgen.MixItem |
---|
children, datatype, indent, linktype, name, parents, UNRECOG |
Constructor Summary | |
---|---|
MixNode(java.lang.String name,
java.lang.String theta,
boolean sparse)
create a visible node |
|
MixNode(java.lang.String name,
java.lang.String theta,
java.lang.String alpha)
constructs a hidden node |
Method Summary | |
---|---|
java.lang.String |
assignVarsInput()
assign input to the variables of this edge |
boolean |
check(java.io.PrintStream out)
check node consistency |
boolean |
classify()
classify the data and linking types of this node. |
void |
coupleNode(MixNode node)
couple the node with the argument. |
void |
coupleParams()
couple the parameters of coupled nodes |
java.lang.String |
declareVars()
declare node structures |
java.lang.String |
expandSelector(MixSequence seq,
boolean theta,
boolean alpha,
java.util.List<MixEdge> ee,
boolean q)
expand selector code, replacing indices appropriately. |
java.lang.String |
getAlphaEstimator()
generate a hyperparameter estimator for this node, based on DirichletEstimation methods |
MixEdge |
getChildEdge(int i)
|
MixEdge |
getChildEdge(java.lang.String x)
|
java.util.List<MixEdge> |
getChildren()
|
java.lang.String |
getComponentCount()
get the count of the components according to the kSel expression. |
java.util.List<MixNode> |
getCoupledNodes()
get couple nodes as a shortcut to resolving a C3 structure. |
MixEdge |
getEdge(java.lang.String x)
get the edge from its variable. |
java.lang.String |
getGibbsTerm(MixSequence seq,
java.util.List<MixEdge> ee,
boolean q)
|
java.lang.String |
getLatexGibbsTerm(MixSequence seq,
java.util.List<MixEdge> ee,
boolean q,
boolean mathml)
latex description of this node's inference term |
java.lang.String |
getLikelihoodTerm(MixSequence seq,
java.util.List<MixEdge> ee)
get the likelihood term for this node |
java.lang.String |
getName()
short name of this node |
MixEdge |
getParentEdge(int i)
|
MixEdge |
getParentEdge(java.lang.String x)
|
java.util.List<MixEdge> |
getParents()
|
java.lang.String |
getThetaEstimator(boolean q)
generate a parameter estimator, based on the Dirichlet posterior mean |
java.lang.String |
getVariable()
|
java.lang.String |
incNode(MixSequence seq,
java.util.List<MixEdge> ee,
boolean inc,
boolean q,
boolean synced)
return code to increment this node's counts |
java.lang.String |
initVars(boolean q)
initialise this node |
int |
intersection(java.util.List<MixEdge> eeSamp)
checks whether the set of edges intersects with the node, i.e., whether one of its elements is a parent or child edge of this node |
(package private) java.lang.String |
kIndex(MixSequence seq,
java.util.List<MixEdge> ee)
return the index that expandIndex assigns a value to, so the result of expandIndex is directly used in computations. |
java.lang.String |
listTypedVarsInput(java.util.Set<java.lang.String> unique)
list the variables for this node comma-separated, adding to the set unique and ignoring variables already in it. |
java.lang.String |
listVarsInput(java.util.Set<java.lang.String> unique)
list the variables for this node comma-separated, adding to the set unique and ignoring variables already in it. |
void |
nameEmptyVars()
complete the selector and index structures after the network has been connected and classified |
java.lang.String |
printDetails()
|
java.lang.String |
printSelector()
print selector string (may be large) |
java.lang.String |
printType()
print the type of this node |
void |
setConstants(java.util.Map<java.lang.String,java.lang.String> constants)
set any constant for this node |
(package private) java.lang.String[] |
tIndex(MixSequence seq,
java.util.List<MixEdge> ee,
boolean forQuery)
determine the index of the output edge, given the active edges ee (qualified by h) and the current sequence |
java.lang.String |
toString()
|
Methods inherited from class org.knowceans.topics.cgen.MixItem |
---|
typeString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int VISIBLE
public static final int SEQUENCE
public static final int TOPIC
public static final int HIDDEN
public static final int N6AGGREG
public static final int C1ROOT
public static final int C1ASINGLE
public static final int C1BSEQADD
public static final int C2MULTI
public static final int C3MERGED
public static final int C4SWITCH
public static final int C5COUPLED
public static final int C5MAIN
public static final int SEQINPUT
public static final int C1INPUT
public static final int E2SPLIT
java.lang.String theta
java.lang.String ntheta
java.lang.String nthetasum
java.lang.String k
java.lang.String K
java.lang.String constK
java.lang.String T
java.lang.String alpha
int dimAlpha
boolean fixedAlpha
java.lang.String j
public java.lang.String J
java.lang.String kSel
java.lang.String jSel
public static java.util.List<MixEdge> NOEDGE
java.util.List<MixNode> coupledNodes
MixNode coupledMainNode
boolean sparse
Constructor Detail |
---|
public MixNode(java.lang.String name, java.lang.String theta, java.lang.String alpha)
name
- theta
- alpha
- public MixNode(java.lang.String name, java.lang.String theta, boolean sparse)
name
- theta
- sparse
- whether it is connected with a label sequence (like authors)
that associates only the non-null subset of the domainMethod Detail |
---|
public void coupleNode(MixNode node)
node
- public boolean classify()
classify
in class MixItem
public void nameEmptyVars()
public void coupleParams()
public int intersection(java.util.List<MixEdge> eeSamp)
n
- eeSamp
-
public java.util.List<MixNode> getCoupledNodes()
public MixEdge getChildEdge(int i)
public MixEdge getChildEdge(java.lang.String x)
public MixEdge getParentEdge(int i)
public MixEdge getParentEdge(java.lang.String x)
public java.util.List<MixEdge> getParents()
getParents
in class MixItem
public java.util.List<MixEdge> getChildren()
getChildren
in class MixItem
public java.lang.String getComponentCount()
Alternatively, an expression in K may be used.
public MixEdge getEdge(java.lang.String x)
x
-
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String printSelector()
public java.lang.String printType()
MixItem
printType
in class MixItem
public java.lang.String printDetails()
printDetails
in class MixItem
public java.lang.String getVariable()
getVariable
in class MixItem
public void setConstants(java.util.Map<java.lang.String,java.lang.String> constants)
setConstants
in class MixItem
public boolean check(java.io.PrintStream out)
check
in class MixItem
public java.lang.String getName()
getName
in class MixItem
public java.lang.String listVarsInput(java.util.Set<java.lang.String> unique)
listVarsInput
in class MixItem
public java.lang.String listTypedVarsInput(java.util.Set<java.lang.String> unique)
listTypedVarsInput
in class MixItem
public java.lang.String assignVarsInput()
assignVarsInput
in class MixItem
public java.lang.String declareVars()
declareVars
in class MixItem
u
- n
-
public java.lang.String initVars(boolean q)
initVars
in class MixItem
q
-
public java.lang.String expandSelector(MixSequence seq, boolean theta, boolean alpha, java.util.List<MixEdge> ee, boolean q)
TODO: allow complex statements in brackets
theta
- expand for theta: k = kSelalpha
- expand for alpha: j = jSelq
-
java.lang.String kIndex(MixSequence seq, java.util.List<MixEdge> ee)
seq
- ee
- forQuery
-
java.lang.String[] tIndex(MixSequence seq, java.util.List<MixEdge> ee, boolean forQuery)
seq
- ee
- forQuery
-
public java.lang.String getGibbsTerm(MixSequence seq, java.util.List<MixEdge> ee, boolean q)
public java.lang.String getLatexGibbsTerm(MixSequence seq, java.util.List<MixEdge> ee, boolean q, boolean mathml)
seq
- ee
- q
- mathml
- (or latex)
public java.lang.String incNode(MixSequence seq, java.util.List<MixEdge> ee, boolean inc, boolean q, boolean synced)
ee
- active edgesinc
- whether to increment or decrementq
- for queryingsynced
- use synchronisation
public java.lang.String getLikelihoodTerm(MixSequence seq, java.util.List<MixEdge> ee)
seq
- ee
-
public java.lang.String getThetaEstimator(boolean q)
public java.lang.String getAlphaEstimator()
DirichletEstimation
methods
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |