use of com.sri.ai.praise.core.representation.interfacebased.factor.core.table.TableFactorNetwork in project aic-praise by aic-sri-international.
the class BenchmarkingIsingModel method testAEBPP.
private static void testAEBPP(AEBPTestingDataFrame df, int runNumber, int timeLimit, List<TableFactor> network, TableVariable query, String netName) {
TableFactorNetwork factorNet = new TableFactorNetwork(network);
println("solveWithExactBP : " + netName + "; iteration: " + runNumber);
AEBPTestingDataFrame dfToAdd = solveWithGabriels(query, factorNet, timeLimit, netName, runNumber);
addRowsFromSecondDfToFirstDf(df, dfToAdd);
toCsv(df);
}
use of com.sri.ai.praise.core.representation.interfacebased.factor.core.table.TableFactorNetwork in project aic-praise by aic-sri-international.
the class BenchmarkingIsingModel method testEBPP.
private static void testEBPP(AEBPTestingDataFrame df, int nRepetitions, List<TableFactor> network, TableVariable query, String netName) {
TableFactorNetwork factorNetwork = new TableFactorNetwork(network);
ExactBPNode<Variable, Factor> exactBP = new ExactBP(query, factorNetwork);
for (int i = 0; i < nRepetitions; i++) {
println("solveWithExactBP : " + netName);
Pair<Double, Factor> p = solveAndPrint(exactBP);
df.addRow(// run number
i, // iteration
-1, // minPTrue
((TableFactor) p.second).getEntries().get(0), // MaxPTrue
((TableFactor) p.second).getEntries().get(0), // iteration time
p.first, // total time
p.first, // InferenceMethodUsed
"ExactBP", // GraphicalModelName
netName + "; query: " + query.toString());
}
}
use of com.sri.ai.praise.core.representation.interfacebased.factor.core.table.TableFactorNetwork in project aic-praise by aic-sri-international.
the class TestCases method uaiModelToListOfTableFactors.
public static ArrayList<TableFactor> uaiModelToListOfTableFactors(UAIModel model) {
TableFactorNetwork net = new TableFactorNetwork(model);
ArrayList<TableFactor> result = mapIntoArrayList(net.getAs(), (fwrapper) -> (TableFactor) fwrapper.getObject());
return result;
}
Aggregations