|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tuffy.ground.Grounding
public class Grounding
This class handles the grounding process of MLN inference/learning with SQL queries. See our technical report at http://tuffguy.cs.wisc.edu/tuffy/tuffy-tech-report.pdf as well as prior works: http://alchemy.cs.washington.edu/papers/singla06a/singla06a.pdf http://alchemy.cs.washington.edu/papers/pdfs/shavlik-natarajan09.pdf Alchemy implements "lazy inference" with a one-step look-ahead strategy for initial groundings; we generalize it into a closure algorithm that avoid incremental "activation" altogether.
Field Summary | |
---|---|
private RDB |
db
Relational database used for grounding. |
private MarkovLogicNetwork |
mln
MLN to be grounded. |
private int |
numAtoms
Number of active atoms. |
private int |
numClauses
Number of active clauses. |
Constructor Summary | |
---|---|
Grounding(MarkovLogicNetwork mln)
Create a grounding worker for an MLN. |
Method Summary | |
---|---|
private void |
activateQueryAtoms()
Activate all the query atoms that are true in the training data. |
private void |
activateSoftEvidence()
Activate "soft evidence" atoms. |
private void |
activateUnknownAtoms()
|
private void |
addKeyConstraintClauses(java.lang.String relAtoms,
java.lang.String cbuffer)
|
private void |
addSoftEvidClauses(java.lang.String relAtoms,
java.lang.String cbuffer)
|
private void |
bindDB(RDB adb)
Bind to a database connection, and initialize global database objects. |
private void |
computeActiveAtoms()
Compute the closure of active atoms. |
private void |
computeActiveClauses(java.lang.String cbuffer)
Computes ground clauses activated by the current set of active atoms. |
private void |
computeIncidenceTable(java.lang.String relClauses,
java.lang.String relIncidence)
Create the atom-clause incidence relation. |
private int |
consolidateClauses(java.lang.String cbuffer,
java.lang.String relClauses)
|
void |
constructMRF()
Construct the MRF. |
private void |
createActTables()
|
private void |
createAtomTable(java.lang.String rel)
|
private void |
createClauseTable(java.lang.String rel)
|
private void |
destroyActTables()
|
MarkovLogicNetwork |
getMLN()
Get the MLN object used for grounding. |
int |
getNumAtoms()
Return the number of active atoms in the grounding result. |
int |
getNumClauses()
Return the number of active clauses in the grounding result. |
private int |
populateAtomTable(java.lang.String relAtoms)
|
private void |
reportCostStats(java.lang.String relClauses)
An attempt of computing cost lower bounds with the probabilistic method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private RDB db
private MarkovLogicNetwork mln
private int numAtoms
private int numClauses
Constructor Detail |
---|
public Grounding(MarkovLogicNetwork mln)
Method Detail |
---|
public MarkovLogicNetwork getMLN()
public int getNumAtoms()
public int getNumClauses()
private void createAtomTable(java.lang.String rel)
private void createClauseTable(java.lang.String rel)
private void createActTables()
private void destroyActTables()
private void activateSoftEvidence()
private void activateQueryAtoms()
private void activateUnknownAtoms()
private void bindDB(RDB adb)
public void constructMRF()
private int populateAtomTable(java.lang.String relAtoms)
private void computeActiveAtoms()
private void computeIncidenceTable(java.lang.String relClauses, java.lang.String relIncidence)
private void computeActiveClauses(java.lang.String cbuffer)
Config#calcCostOffset
,
and fcid Config.track_clause_provenance
.
retainInactiveAtoms
- set this to true when
the original lazy inference is in use. Otherwise, i.e. the closure
algorithm is in use, set it to false.private int consolidateClauses(java.lang.String cbuffer, java.lang.String relClauses)
private void addSoftEvidClauses(java.lang.String relAtoms, java.lang.String cbuffer)
private void addKeyConstraintClauses(java.lang.String relAtoms, java.lang.String cbuffer)
private void reportCostStats(java.lang.String relClauses)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |