org.knowceans.topics.cgen
Class MixEdge

java.lang.Object
  extended by org.knowceans.topics.cgen.MixItem
      extended by org.knowceans.topics.cgen.MixEdge

public class MixEdge
extends MixItem

represents a mixture edge


Field Summary
static int C3MERGED
           
(package private)  java.lang.String constT
          constant value for T or null
static int E1E3SINGLE
          E1 and E3 can often be treated identical, the edge has simply different children
static int E1SINGLE
          E1 single output (linear structure)
static int E2MULTI
          E2 multiple input
static int E3COUPLED
          E3 multiple coupled outputs
static int E4AGGREG
          E4 aggregation (set a priori)
static int HIDDEN
          unknown sequence (= non-terminal)
static int QFIXED
          qualifies HIDDEN to be fixed at test time (chile topic or visible nodes that don't change between training and testing)
static int QHIDDEN
          semi-supervised setting: qualifies VISIBLE to be unknown at test time
static int ROOT
          sequence index = (= root in graph)
(package private)  MixSequence sequence
          relevant sequence
(package private)  java.util.List<MixEdge> siblingsE2
          siblings with identical variable
(package private)  boolean sparse
          whether this edge transports sparse data, i.e., indexed by its parent's observed input
(package private)  java.lang.String T
          range name
static int VISANY
           
static int VISIBLE
          data sequence (= leaf in graph)
static int VISROOT
          sequence index = (= root in graph with non-index values, labels)
(package private)  java.lang.String x
          variable name
 
Fields inherited from class org.knowceans.topics.cgen.MixItem
children, datatype, indent, linktype, name, parents, UNRECOG
 
Constructor Summary
MixEdge(java.lang.String name, java.lang.String x, java.lang.String T, MixSequence seq)
          create a mixture edge
 
Method Summary
 java.lang.String assignTopic(boolean q)
           
 java.lang.String assignVarsInput()
          assign input to the variables of this edge
 boolean check(java.io.PrintStream out)
           
 boolean classify()
          classify the data and linking types of this edge.
 void classifyPostNode()
          after node classification, use this to finalise.
 java.lang.String declareVars()
          declare the variables of this node
 MixNode getChildNode(int i)
           
 java.util.List<MixNode> getChildren()
           
 java.lang.String getName()
          get a short name of this node
 MixNode getParentNode(int i)
           
 java.util.List<MixNode> getParents()
           
 java.lang.String getTopic(boolean q, boolean declare)
          get the current topic
 java.lang.String getVariable()
           
 java.lang.String initVars(boolean q)
          initialise variables
 java.lang.String listTypedVarsInput(java.util.Set<java.lang.String> unique)
          list the variables needed at the input
 java.lang.String listVarsInput(java.util.Set<java.lang.String> unique)
          list the variables needed at the input
 java.lang.String printDetails()
           
 java.lang.String printType()
          print the type of this node
 java.lang.String qualify(java.util.List<MixEdge> ee, boolean q)
          get edge qualified as an index.
 void setConstants(java.util.Map<java.lang.String,java.lang.String> constants)
          set any constant for this edge (currently T)
 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

ROOT

public static final int ROOT
sequence index = (= root in graph)

See Also:
Constant Field Values

VISROOT

public static final int VISROOT
sequence index = (= root in graph with non-index values, labels)

See Also:
Constant Field Values

HIDDEN

public static final int HIDDEN
unknown sequence (= non-terminal)

See Also:
Constant Field Values

VISIBLE

public static final int VISIBLE
data sequence (= leaf in graph)

See Also:
Constant Field Values

QFIXED

public static final int QFIXED
qualifies HIDDEN to be fixed at test time (chile topic or visible nodes that don't change between training and testing)

See Also:
Constant Field Values

QHIDDEN

public static final int QHIDDEN
semi-supervised setting: qualifies VISIBLE to be unknown at test time

See Also:
Constant Field Values

VISANY

public static final int VISANY
See Also:
Constant Field Values

E1SINGLE

public static final int E1SINGLE
E1 single output (linear structure)

See Also:
Constant Field Values

E2MULTI

public static final int E2MULTI
E2 multiple input

See Also:
Constant Field Values

E3COUPLED

public static final int E3COUPLED
E3 multiple coupled outputs

See Also:
Constant Field Values

E1E3SINGLE

public static final int E1E3SINGLE
E1 and E3 can often be treated identical, the edge has simply different children

See Also:
Constant Field Values

E4AGGREG

public static final int E4AGGREG
E4 aggregation (set a priori)

See Also:
Constant Field Values

C3MERGED

public static final int C3MERGED
See Also:
Constant Field Values

x

java.lang.String x
variable name


T

java.lang.String T
range name


constT

java.lang.String constT
constant value for T or null


sequence

MixSequence sequence
relevant sequence


sparse

boolean sparse
whether this edge transports sparse data, i.e., indexed by its parent's observed input


siblingsE2

java.util.List<MixEdge> siblingsE2
siblings with identical variable

Constructor Detail

MixEdge

public MixEdge(java.lang.String name,
               java.lang.String x,
               java.lang.String T,
               MixSequence seq)
create a mixture edge

Parameters:
name -
x - var
T - range
seq - sequence
Method Detail

classify

public boolean classify()
classify the data and linking types of this edge. Use after node incidence deduplication, but can be used before node classification.

Specified by:
classify in class MixItem
Returns:
false if invalid

classifyPostNode

public void classifyPostNode()
after node classification, use this to finalise. This essentially finds QFIXED compliance.


getChildNode

public MixNode getChildNode(int i)

getParentNode

public MixNode getParentNode(int i)

getParents

public java.util.List<MixNode> getParents()
Overrides:
getParents in class MixItem

getChildren

public java.util.List<MixNode> getChildren()
Overrides:
getChildren in class MixItem

toString

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

printType

public java.lang.String printType()
Description copied from class: MixItem
print the type of this node

Specified by:
printType in class MixItem
Returns:

printDetails

public java.lang.String printDetails()
Overrides:
printDetails in class MixItem

getVariable

public java.lang.String getVariable()
Specified by:
getVariable in class MixItem

check

public boolean check(java.io.PrintStream out)
Overrides:
check in class MixItem

setConstants

public void setConstants(java.util.Map<java.lang.String,java.lang.String> constants)
set any constant for this edge (currently T)

Overrides:
setConstants in class MixItem

listVarsInput

public java.lang.String listVarsInput(java.util.Set<java.lang.String> unique)
list the variables needed at the input

Specified by:
listVarsInput in class MixItem
Returns:

listTypedVarsInput

public java.lang.String listTypedVarsInput(java.util.Set<java.lang.String> unique)
list the variables needed at the input

Specified by:
listTypedVarsInput in class MixItem
Returns:

assignVarsInput

public java.lang.String assignVarsInput()
assign input to the variables of this edge

Specified by:
assignVarsInput in class MixItem
Returns:

declareVars

public java.lang.String declareVars()
Description copied from class: MixItem
declare the variables of this node

Specified by:
declareVars in class MixItem

getName

public java.lang.String getName()
Description copied from class: MixItem
get a short name of this node

Specified by:
getName in class MixItem
Returns:

initVars

public java.lang.String initVars(boolean q)
Description copied from class: MixItem
initialise variables

Specified by:
initVars in class MixItem
Returns:

getTopic

public java.lang.String getTopic(boolean q,
                                 boolean declare)
get the current topic

Parameters:
q -
declare -
Returns:

assignTopic

public java.lang.String assignTopic(boolean q)

qualify

public java.lang.String qualify(java.util.List<MixEdge> ee,
                                boolean q)
get edge qualified as an index.

Parameters:
ee -
Returns: