|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectLBJ2.infer.Inference
public abstract class Inference
An object of this class keeps track of all the information necessary to perform inference. Once that inference has been performed, constrained classifiers access the results through this class's interface to determine what their constrained predictions are.
| Field Summary | |
|---|---|
protected Constraint |
constraint
The constraints which must be satisfied by the inference algorithm. |
protected java.lang.Object |
head
Objects of this class are differentiated by their "head" objects. |
protected java.util.LinkedHashMap |
variables
The values of this map are the variables we perform inference over; they are the actual FirstOrderVariable objects found in this
inference's constraints. |
| Constructor Summary | |
|---|---|
Inference()
Default constructor. |
|
Inference(java.lang.Object h)
Initializes the head object. |
|
| Method Summary | |
|---|---|
static java.lang.String |
exampleToString(java.lang.Object example)
Produces a string representation of an example object. |
java.lang.Object |
getHead()
Retrieves the head object. |
java.lang.String[] |
getHeadFinderTypes()
Returns the fully qualified names of the types of objects for which head finder methods have been defined. |
java.lang.String |
getHeadType()
Returns the fully qualified name of the type of the head object for this inference. |
Normalizer |
getNormalizer(Learner c)
Returns the normalization function associated with the given classifier in this inference. |
FirstOrderVariable |
getVariable(FirstOrderVariable v)
Retrieves the requested variable, creating it first if it doesn't yet exist. |
PropositionalVariable |
getVariable(PropositionalVariable v)
Retrieves the requested variable, creating it first if it doesn't yet exist. |
protected abstract void |
infer()
Derived classes implement this method to perform the inference, setting the values of the variables such that they maximize the objective function while satisfying the constraints. |
boolean |
satisfied()
Determines if the constraints are satisfied by the current variable assignments. |
abstract java.lang.String |
valueOf(Learner c,
java.lang.Object o)
Retrieves the value of the specified variable as identified by the classifier and the object that produce that variable. |
void |
visit(AtLeastQuantifier c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(AtMostQuantifier c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(ExistentialQuantifier c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(FirstOrderConjunction c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(FirstOrderConstant c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(FirstOrderDisjunction c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(FirstOrderDoubleImplication c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(FirstOrderEqualityTwoValues c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(FirstOrderEqualityWithValue c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(FirstOrderEqualityWithVariable c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(FirstOrderImplication c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(FirstOrderNegation c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(PropositionalAtLeast c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(PropositionalConjunction c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(PropositionalConstant c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(PropositionalDisjunction c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(PropositionalDoubleImplication c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(PropositionalImplication c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(PropositionalNegation c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(PropositionalVariable c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(QuantifiedConstraintInvocation c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(UniversalQuantifier c)
Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visitAll(Constraint c)
The default method for visiting a constraint simply visits that constraint's children. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.LinkedHashMap variables
FirstOrderVariable objects found in this
inference's constraints. The keys are also objects of type
FirstOrderVariable, but they are not necessarily the actual
objects found in the constraints. This map is populated by the first
evaluation of the constraints.
protected Constraint constraint
protected java.lang.Object head
| Constructor Detail |
|---|
public Inference()
public Inference(java.lang.Object h)
h - The head object.| Method Detail |
|---|
public static java.lang.String exampleToString(java.lang.Object example)
example - The example object, which may be an array.
example.public java.lang.Object getHead()
protected abstract void infer()
throws java.lang.Exception
Foo, it may be assumed that the
constraint member field has already been filled in
appropriately, since the LBJ compiler will generate a class extending
Foo whose constructor does so.
java.lang.Exception
public abstract java.lang.String valueOf(Learner c,
java.lang.Object o)
throws java.lang.Exception
c - The classifier producing the variable.o - The object from which the variable is produced.
java.lang.Exceptionpublic Normalizer getNormalizer(Learner c)
IdentityNormalizer.
c - The classifier.
public java.lang.String getHeadType()
"java.lang.Object". It should be overridden by derived
classes.
public java.lang.String[] getHeadFinderTypes()
Inference is required to have at least one head finder.
Inference classes written by the compiler automatically
override this method appropriately.
public boolean satisfied()
public PropositionalVariable getVariable(PropositionalVariable v)
v - A variable containing the same classifier, object, and
prediction value as the desired variable.
public FirstOrderVariable getVariable(FirstOrderVariable v)
v - A variable containing the same classifier and object as the
desired variable.
public void visitAll(Constraint c)
public void visit(FirstOrderDoubleImplication c)
c - The constraint to process.public void visit(FirstOrderImplication c)
c - The constraint to process.public void visit(FirstOrderConjunction c)
c - The constraint to process.public void visit(FirstOrderDisjunction c)
c - The constraint to process.public void visit(FirstOrderEqualityTwoValues c)
c - The constraint to process.public void visit(FirstOrderEqualityWithValue c)
c - The constraint to process.public void visit(FirstOrderEqualityWithVariable c)
c - The constraint to process.public void visit(FirstOrderNegation c)
c - The constraint to process.public void visit(FirstOrderConstant c)
c - The constraint to process.public void visit(UniversalQuantifier c)
c - The constraint to process.public void visit(ExistentialQuantifier c)
c - The constraint to process.public void visit(AtLeastQuantifier c)
c - The constraint to process.public void visit(AtMostQuantifier c)
c - The constraint to process.public void visit(QuantifiedConstraintInvocation c)
c - The constraint to process.public void visit(PropositionalDoubleImplication c)
c - The constraint to process.public void visit(PropositionalImplication c)
c - The constraint to process.public void visit(PropositionalConjunction c)
c - The constraint to process.public void visit(PropositionalDisjunction c)
c - The constraint to process.public void visit(PropositionalAtLeast c)
c - The constraint to process.public void visit(PropositionalConstant c)
c - The constraint to process.public void visit(PropositionalNegation c)
c - The constraint to process.public void visit(PropositionalVariable c)
c - The constraint to process.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||