From 8452eaf90cb999ba780b5ec757230b1a5db2ba03 Mon Sep 17 00:00:00 2001 From: "trevor.cohn" Date: Thu, 5 Aug 2010 13:56:29 +0000 Subject: Debugged PR-phrase-context and tuned projected gradient to BTEC git-svn-id: https://ws10smt.googlecode.com/svn/trunk@481 ec762483-ff6d-05da-a07a-a48fb63a330f --- .../prjava/src/phrase/PhraseContextObjective.java | 66 ++++++++++++++-------- .../prjava/src/phrase/PhraseObjective.java | 9 +-- 2 files changed, 47 insertions(+), 28 deletions(-) (limited to 'gi/posterior-regularisation/prjava/src/phrase') diff --git a/gi/posterior-regularisation/prjava/src/phrase/PhraseContextObjective.java b/gi/posterior-regularisation/prjava/src/phrase/PhraseContextObjective.java index 5947c4be..646ff392 100644 --- a/gi/posterior-regularisation/prjava/src/phrase/PhraseContextObjective.java +++ b/gi/posterior-regularisation/prjava/src/phrase/PhraseContextObjective.java @@ -27,8 +27,9 @@ public class PhraseContextObjective extends ProjectedObjective { private static final double GRAD_DIFF = 0.00002; private static double INIT_STEP_SIZE = 300; - private static double VAL_DIFF = 1e-4; // FIXME needs to be tuned - private static int ITERATIONS = 100; + private static double VAL_DIFF = 1e-8; + private static int ITERATIONS = 20; + boolean debug = false; private PhraseCluster c; @@ -52,7 +53,7 @@ public class PhraseContextObjective extends ProjectedObjective // likelihood under p public double llh; - private Map edgeIndex; + private static Map edgeIndex; private long projectionTime; private long objectiveTime; @@ -84,10 +85,15 @@ public class PhraseContextObjective extends ProjectedObjective projectionContext = new SimplexProjection(scaleCT); q=new double [data.size()][c.K]; - edgeIndex = new HashMap(); - for (int e=0; e(); + for (int e=0; e