public FactorTable sumOutFront() { FactorTable ft = new FactorTable(numClasses, windowSize - 1); int stride = ft.size(); for (int i = 0; i < stride; i++) { ft.setValue(i, ArrayMath.logSum(table, i, table.length, stride)); } return ft; }
ft.setValue(label, weight);
for (int k = 0; k < numClasses; k++) { int[] b = { i, j, k }; ft.setValue(b, (i * 4) + (j * 2) + k); for (int j = 0; j < numClasses; j++) { int[] b = { i, j }; ft2.setValue(b, i * numClasses + j); ft3.setValue(new int[] {0, 0, 0}, Math.log(0.25)); ft3.setValue(new int[] {0, 0, 1}, Math.log(0.35)); ft3.setValue(new int[] {0, 1, 0}, Math.log(0.05)); ft3.setValue(new int[] {0, 1, 1}, Math.log(0.07)); ft3.setValue(new int[] {1, 0, 0}, Math.log(0.08)); ft3.setValue(new int[] {1, 0, 1}, Math.log(0.16)); ft3.setValue(new int[] {1, 1, 0}, Math.log(1e-50)); ft3.setValue(new int[] {1, 1, 1}, Math.log(1e-50));
ft.setValue(label, cliquePotential);
public FactorTable sumOutFront() { FactorTable ft = new FactorTable(numClasses, windowSize - 1); int stride = ft.size(); for (int i = 0; i < stride; i++) { ft.setValue(i, ArrayMath.logSum(table, i, table.length, stride)); } return ft; }
public FactorTable sumOutFront() { FactorTable ft = new FactorTable(numClasses, windowSize - 1); int stride = ft.size(); for (int i = 0; i < stride; i++) { ft.setValue(i, ArrayMath.logSum(table, i, table.length, stride)); } return ft; }
for (int k = 0; k < numClasses; k++) { int[] b = { i, j, k }; ft.setValue(b, (i * 4) + (j * 2) + k); for (int j = 0; j < numClasses; j++) { int[] b = { i, j }; ft2.setValue(b, i * numClasses + j); ft3.setValue(new int[] {0, 0, 0}, Math.log(0.25)); ft3.setValue(new int[] {0, 0, 1}, Math.log(0.35)); ft3.setValue(new int[] {0, 1, 0}, Math.log(0.05)); ft3.setValue(new int[] {0, 1, 1}, Math.log(0.07)); ft3.setValue(new int[] {1, 0, 0}, Math.log(0.08)); ft3.setValue(new int[] {1, 0, 1}, Math.log(0.16)); ft3.setValue(new int[] {1, 1, 0}, Math.log(1e-50)); ft3.setValue(new int[] {1, 1, 1}, Math.log(1e-50));
ft.setValue(label, weight);
ft.setValue(label, weight);
for (int k = 0; k < numClasses; k++) { int[] b = { i, j, k }; ft.setValue(b, (i * 4) + (j * 2) + k); for (int j = 0; j < numClasses; j++) { int[] b = { i, j }; ft2.setValue(b, i * numClasses + j); ft3.setValue(new int[] {0, 0, 0}, Math.log(0.25)); ft3.setValue(new int[] {0, 0, 1}, Math.log(0.35)); ft3.setValue(new int[] {0, 1, 0}, Math.log(0.05)); ft3.setValue(new int[] {0, 1, 1}, Math.log(0.07)); ft3.setValue(new int[] {1, 0, 0}, Math.log(0.08)); ft3.setValue(new int[] {1, 0, 1}, Math.log(0.16)); ft3.setValue(new int[] {1, 1, 0}, Math.log(1e-50)); ft3.setValue(new int[] {1, 1, 1}, Math.log(1e-50));
ft.setValue(label, cliquePotential);
ft.setValue(label, cliquePotential);
ft.setValue(label, weight);
ft.setValue(label, weight);