|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfer.MRF
infer.MCSAT
public class MCSAT
The MC-SAT algorithm for marginal inference. http://www.cs.washington.edu/homes/pedrod/papers/aaai08c.pdf
Field Summary | |
---|---|
java.util.HashMap<java.lang.String,java.lang.Long> |
clauseNiNjViolationTallies
This map records the tallies for calculating E(v_i*v_j). |
java.util.HashMap<java.lang.String,java.lang.Long> |
clauseSatTallies
This array records total number of satisfaction for a clause. |
java.util.HashMap<java.lang.String,java.lang.Long> |
clauseSquareVioTallies
This array records total number of square violation for a clause. |
java.util.HashMap<java.lang.String,java.lang.Long> |
clauseVioTallies
This array records total number of violation for a clause. |
java.util.HashMap<java.lang.String,java.lang.Double> |
expectationOfNiNjViolation
This map records the expectation of E(v_i*v_j). |
java.util.HashMap<java.lang.String,java.lang.Double> |
expectationOfSatisfication
This array records the expection of #satisfaction for each clause. |
java.util.HashMap<java.lang.String,java.lang.Double> |
expectationOfSquareViolation
This map records the expectation of square #violation for each clause. |
java.util.HashMap<java.lang.String,java.lang.Double> |
expectationOfViolation
This map records the expectation of #violation for each clause. |
int |
nClauseVioTallies
Number of iterations of tallies. |
Fields inherited from class infer.MRF |
---|
adj, atoms, clauses, dirtyAtoms, fout, inferOps, lowCost, sampleSatMode, totalAlive, totalCost, unsat |
Constructor Summary | |
---|---|
MCSAT(Grounding grounding)
Constructor of MCSAT. |
Method Summary | |
---|---|
void |
calcExpViolation()
Calculating the different expectations by filling the HashMaps related to expectations in this class. |
void |
dumpAtomProb(int numSamples,
java.lang.String fout)
Dump result of MCSAT inference to output file. |
void |
flushNewWeight2DB(java.util.HashMap<java.lang.String,java.lang.Double> currentWeight)
Change the weight of GClause based on updated weight of Clause. |
void |
mcsat(int numSamples,
int numFlips)
Execute the MC-SAT algorithm. |
protected int |
retainOnlyHardClauses()
Kill soft clauses. |
boolean |
sampleSAT(int nSteps)
SampleSAT (with WalkSAT inside), used to uniformly sample a zero-cost world. |
protected void |
updateAtomTruthTallies()
For each atom, increment its truth tally by one if it's currently true. |
void |
updateClauseVoiTallies()
Update the number of violations of a clause. |
Methods inherited from class infer.MRF |
---|
addAtom, auditClauseViolations, buildIndices, calcCosts, discard, enableAllClauses, fixAtom, flushLowTruth, inferSweepSAT, inferWalkSAT, initMRF, invalidateLowCost, isAlwaysTrue, isTrueLit, loadMRF, ownsAtom, recalcCost, restoreLowTruth, retainSomeGoodClauses, saveLowTruth, testChance, unfixAllAtoms |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.util.HashMap<java.lang.String,java.lang.Long> clauseNiNjViolationTallies
public java.util.HashMap<java.lang.String,java.lang.Long> clauseSatTallies
public java.util.HashMap<java.lang.String,java.lang.Long> clauseSquareVioTallies
nClauseVioTallies
will give the estimated expectation of #violation.
public java.util.HashMap<java.lang.String,java.lang.Long> clauseVioTallies
nClauseVioTallies
will give the estimated expectation of #violation.
public java.util.HashMap<java.lang.String,java.lang.Double> expectationOfNiNjViolation
calcExpViolation()
.
public java.util.HashMap<java.lang.String,java.lang.Double> expectationOfSatisfication
calcExpViolation()
.
public java.util.HashMap<java.lang.String,java.lang.Double> expectationOfSquareViolation
calcExpViolation()
.
public java.util.HashMap<java.lang.String,java.lang.Double> expectationOfViolation
calcExpViolation()
.
public int nClauseVioTallies
Constructor Detail |
---|
public MCSAT(Grounding grounding)
grounding
- Grounding worker based on which this
MCSAT instance forms the MRF.Method Detail |
---|
public void calcExpViolation()
public void dumpAtomProb(int numSamples, java.lang.String fout)
numSamples
- number of samples in this MCSAT inference. This is
used to estimate the probability of an atom being true.fout
- Name of output file.public void flushNewWeight2DB(java.util.HashMap<java.lang.String,java.lang.Double> currentWeight)
currentWeight
- The weight of clauses to be flushed
in this MCSAT instance.public void mcsat(int numSamples, int numFlips)
numSamples
- number of MC-SAT samplesnumFlips
- number of SampleSAT steps in each iterationprotected int retainOnlyHardClauses()
public boolean sampleSAT(int nSteps)
nSteps
- protected void updateAtomTruthTallies()
public void updateClauseVoiTallies()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |