tuffy.infer
Class InferComponent

java.lang.Object
  extended by tuffy.infer.InferComponent

public class InferComponent
extends java.lang.Object

Performing inference on one MRF component.


Field Summary
private  Component comp
           
private  double lowCost
           
 
Constructor Summary
InferComponent(Component comp)
           
 
Method Summary
 Component getComponent()
           
 double getCost()
           
private  double inferGaussSeidelMap(int rounds, int ntries, int nflips)
          Gauss-Seidel MAP inference scheme.
private  void inferGaussSeidelMarginal(int rounds, int nsamples, int nflips)
          Gauss-Seidel MAP inference scheme.
 void inferMAP(int totalTries, int totalFlipsPerTry)
          Run partition-aware MAP inference with the Gauss-Seidel scheme.
 void inferMarginal(int totalSamples, int totalFlipsPerSample)
          Run partition-aware marginal inference with the Gauss-Seidel scheme.
private  void initTruthRandom()
           
private  double recalcCost()
          Recalculate the cost on this component, which is the sum of the cost on the MRF of each partition.
private  void restoreLowLowTruth()
           
private  void saveLowLowTruth()
           
private  void setMrfInitStrategy(MRF.INIT_STRATEGY strategy)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comp

private Component comp

lowCost

private double lowCost
Constructor Detail

InferComponent

public InferComponent(Component comp)
Method Detail

getCost

public double getCost()

getComponent

public Component getComponent()

inferMAP

public void inferMAP(int totalTries,
                     int totalFlipsPerTry)
Run partition-aware MAP inference with the Gauss-Seidel scheme.


inferMarginal

public void inferMarginal(int totalSamples,
                          int totalFlipsPerSample)
Run partition-aware marginal inference with the Gauss-Seidel scheme.


initTruthRandom

private void initTruthRandom()

setMrfInitStrategy

private void setMrfInitStrategy(MRF.INIT_STRATEGY strategy)

inferGaussSeidelMap

private double inferGaussSeidelMap(int rounds,
                                   int ntries,
                                   int nflips)
Gauss-Seidel MAP inference scheme. Calls WalkSAT on each partition in a round-robin manner.

Parameters:
rounds -
ntries -
nflips - total number of flips per try in one round

inferGaussSeidelMarginal

private void inferGaussSeidelMarginal(int rounds,
                                      int nsamples,
                                      int nflips)
Gauss-Seidel MAP inference scheme. Calls WalkSAT on each partition in a round-robin manner.

Parameters:
rounds -
ntries -
nflips - total number of flips per try in one round

saveLowLowTruth

private void saveLowLowTruth()

restoreLowLowTruth

private void restoreLowLowTruth()

recalcCost

private double recalcCost()
Recalculate the cost on this component, which is the sum of the cost on the MRF of each partition.

See Also:
MRF.recalcCost()