|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cc.mallet.grmm.learning.ACRF.Template
public abstract static class ACRF.Template
A type of clique in the model. Each type of clique is assumed to have the same number of possible outcomes and the same set of weights
Field Summary | |
---|---|
int |
index
|
protected SparseVector[] |
weights
|
Constructor Summary | |
---|---|
ACRF.Template()
|
Method Summary | |
---|---|
abstract void |
addInstantiatedCliques(ACRF.UnrolledGraph graph,
Instance instance)
Adds all instiated cliques for an instance. |
int |
addSomeUnsupportedWeights(InstanceList training)
|
protected Assignment |
computeAssignment(Assignment graphAssn,
VarSet vs)
|
AbstractTableFactor |
computeFactor(ACRF.UnrolledVarSet clique)
|
protected Matrix |
createFactorMatrix(ACRF.UnrolledVarSet clique)
Creates an empty matrix for use in storing factor values when this template is unrolled. |
protected java.util.BitSet |
getAssignmentsPresent()
|
double |
getDefaultWeight(int i)
|
SparseVector |
getDefaultWeights()
|
SparseVector[] |
getWeights()
Returns the weights for this clique template. |
int |
initWeights(InstanceList training)
Initializes the weight vectors to the appropriate size for a set of training data. |
protected boolean |
isSupportedOnly()
|
boolean |
isTrainable()
|
boolean |
isUnsupportedWeightsAdded()
|
protected void |
modifyPotential(ACRF.UnrolledGraph unrolledGraph,
ACRF.UnrolledVarSet clique,
AbstractTableFactor ptl)
Modifies a factor computed from this template. |
void |
setDefaultWeight(int i,
double w)
|
void |
setDefaultWeights(SparseVector w)
|
void |
setTrainable(boolean tr)
|
void |
setWeights(SparseVector[] w)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected SparseVector[] weights
public int index
Constructor Detail |
---|
public ACRF.Template()
Method Detail |
---|
public abstract void addInstantiatedCliques(ACRF.UnrolledGraph graph, Instance instance)
graph
- The graph that the cliques will be added to.instance
- Instance to unroll grpah for. Subclasses are free
to specify what types they expect in the Instance's slots.protected void modifyPotential(ACRF.UnrolledGraph unrolledGraph, ACRF.UnrolledVarSet clique, AbstractTableFactor ptl)
WARNING: If you implement this method, it is likely that you will change the derivative of this factor with respect to weights[]. This means that you will not be able to use the default ACRFTrainer for this template.
unrolledGraph
- The graph in which the factor sitsclique
- The set of nodes which are the domain of the factorptl
- The factor to modifyprotected boolean isSupportedOnly()
public boolean isUnsupportedWeightsAdded()
protected java.util.BitSet getAssignmentsPresent()
public SparseVector[] getWeights()
public void setWeights(SparseVector[] w)
public int initWeights(InstanceList training)
public int addSomeUnsupportedWeights(InstanceList training)
public AbstractTableFactor computeFactor(ACRF.UnrolledVarSet clique)
protected Matrix createFactorMatrix(ACRF.UnrolledVarSet clique)
clique
-
public double getDefaultWeight(int i)
public SparseVector getDefaultWeights()
public void setDefaultWeights(SparseVector w)
public void setDefaultWeight(int i, double w)
public boolean isTrainable()
public void setTrainable(boolean tr)
protected Assignment computeAssignment(Assignment graphAssn, VarSet vs)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |