cc.mallet.grmm.test
Class TestInference

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by cc.mallet.grmm.test.TestInference
All Implemented Interfaces:
junit.framework.Test

public class TestInference
extends junit.framework.TestCase

Torture tests of inference in GRMM. Well, actually, they're not all that torturous, but hopefully they're at least somewhat disconcerting.

Version:
$Id: TestInference.java,v 1.1 2007/10/22 21:37:40 mccallum Exp $
Author:
Charles Sutton

Field Summary
 java.lang.Class[] algorithms
           
 java.lang.Class[] allAlgs
           
 java.lang.Class[] appxAlgs
           
 java.lang.Class[] treeAlgs
           
 
Constructor Summary
TestInference(java.lang.String name)
           
 
Method Summary
static UndirectedModel createRandomGrid(int w, int h, int maxOutcomes, java.util.Random r)
           
static java.util.List createTestModels()
           
 void ignoreTestNumMessages()
           
static void main(java.lang.String[] args)
           
 void runJunctionTree()
           
protected  void setUp()
           
static junit.framework.Test suite()
           
 void testBeliefPropagation()
           
 void testBpJoint()
           
 void testBpLargeModels()
           
 void testDefaultLookupMarginal()
           
 void testDestructiveAssignment()
           
 void testDirectedJt()
           
 void testDisconnectedModel()
           
 void testFactorizedJoint()
           
 void testFindVariable()
           
 void testInfiniteCost()
           
 void testJointConsistent()
           
 void testJtCaching()
           
 void testJtConsistency()
           
 void testJtConstant()
           
 void testJtViterbi()
           
 void testJunctionTreeConnectedFromRoot()
           
 void testLogMarginalize()
           
 void testLogNormalize()
           
 void testLoopyCaching()
           
 void testLoopyConvergence()
           
 void testMarginals()
           
 void testMaxMarginals()
           
 void testMultiply()
           
 void testQuery()
           
 void testSerializable()
           
 void testSingletonGraph()
           
 void testSumLogProb()
           
 void testTreeViterbi()
           
 void testTrp()
           
 void testTrpJoint()
           
 void testTrpLargeModels()
           
 void testTrpNonDestructivity()
          Tests that running TRP doesn't inadvertantly change potentials in the original graph.
 void testTrpOnTrees()
           
 void testTrpReuse()
           
 void testTrpTreeList()
           
 void testTrpViterbiEquiv()
           
 void testTrpViterbiEquiv2()
           
 void testUndirectedIndices()
           
 void testUniformJoint()
           
 void timeMarginalization()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

algorithms

public final java.lang.Class[] algorithms

appxAlgs

public final java.lang.Class[] appxAlgs

allAlgs

public final java.lang.Class[] allAlgs

treeAlgs

public final java.lang.Class[] treeAlgs
Constructor Detail

TestInference

public TestInference(java.lang.String name)
Method Detail

createRandomGrid

public static UndirectedModel createRandomGrid(int w,
                                               int h,
                                               int maxOutcomes,
                                               java.util.Random r)

createTestModels

public static java.util.List createTestModels()

testUniformJoint

public void testUniformJoint()
                      throws java.lang.Exception
Throws:
java.lang.Exception

testJointConsistent

public void testJointConsistent()
                         throws java.lang.Exception
Throws:
java.lang.Exception

testFactorizedJoint

public void testFactorizedJoint()
                         throws java.lang.Exception
Throws:
java.lang.Exception

testMarginals

public void testMarginals()
                   throws java.lang.Exception
Throws:
java.lang.Exception

testQuery

public void testQuery()
               throws java.lang.Exception
Throws:
java.lang.Exception

testSerializable

public void testSerializable()
                      throws java.lang.Exception
Throws:
java.lang.Exception

ignoreTestNumMessages

public void ignoreTestNumMessages()

testJtConsistency

public void testJtConsistency()

testTrp

public void testTrp()

testTrpJoint

public void testTrpJoint()

testTrpNonDestructivity

public void testTrpNonDestructivity()
Tests that running TRP doesn't inadvertantly change potentials in the original graph.


testTrpReuse

public void testTrpReuse()

testTrpTreeList

public void testTrpTreeList()

testUndirectedIndices

public void testUndirectedIndices()

testTrpViterbiEquiv

public void testTrpViterbiEquiv()

testTrpOnTrees

public void testTrpOnTrees()

testTrpViterbiEquiv2

public void testTrpViterbiEquiv2()

testTreeViterbi

public void testTreeViterbi()

testJtViterbi

public void testJtViterbi()

testMaxMarginals

public void testMaxMarginals()
                      throws java.lang.Exception
Throws:
java.lang.Exception

testBeliefPropagation

public void testBeliefPropagation()

testBpJoint

public void testBpJoint()

testDirectedJt

public void testDirectedJt()

setUp

protected void setUp()
Overrides:
setUp in class junit.framework.TestCase

testMultiply

public void testMultiply()

testLogMarginalize

public void testLogMarginalize()

testLogNormalize

public void testLogNormalize()

testSumLogProb

public void testSumLogProb()

testInfiniteCost

public void testInfiniteCost()

testJtCaching

public void testJtCaching()

testFindVariable

public void testFindVariable()

testDefaultLookupMarginal

public void testDefaultLookupMarginal()

testDisconnectedModel

public void testDisconnectedModel()

timeMarginalization

public void timeMarginalization()

runJunctionTree

public void runJunctionTree()

testDestructiveAssignment

public void testDestructiveAssignment()

testLoopyConvergence

public void testLoopyConvergence()

testSingletonGraph

public void testSingletonGraph()

testLoopyCaching

public void testLoopyCaching()

testJunctionTreeConnectedFromRoot

public void testJunctionTreeConnectedFromRoot()

testBpLargeModels

public void testBpLargeModels()

testTrpLargeModels

public void testTrpLargeModels()

testJtConstant

public void testJtConstant()
                    throws java.io.IOException
Throws:
java.io.IOException

suite

public static junit.framework.Test suite()

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception