From 77c25d9f30f95ccb7843f9dce71a4f4e018cc727 Mon Sep 17 00:00:00 2001 From: "trevor.cohn" Date: Mon, 12 Jul 2010 19:48:54 +0000 Subject: Updated launcher to include agreement model. git-svn-id: https://ws10smt.googlecode.com/svn/trunk@226 ec762483-ff6d-05da-a07a-a48fb63a330f --- .../prjava/src/phrase/PhraseObjective.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java') diff --git a/gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java b/gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java index cc12546d..33167c20 100644 --- a/gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java +++ b/gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java @@ -63,7 +63,7 @@ public class PhraseObjective extends ProjectedObjective */ public double llh; - public PhraseObjective(PhraseCluster cluster, int phraseIdx){ + public PhraseObjective(PhraseCluster cluster, int phraseIdx, double scale){ phrase=phraseIdx; c=cluster; data=c.c.getEdgesForPhrase(phrase); @@ -81,7 +81,7 @@ public class PhraseObjective extends ProjectedObjective newPoint = new double[n_param]; gradient = new double[n_param]; initP(); - projection=new SimplexProjection(c.scalePT); + projection=new SimplexProjection(scale); q=new double [data.size()][c.K]; setParameters(parameters); @@ -220,8 +220,8 @@ public class PhraseObjective extends ProjectedObjective return sum; } - public double primal() + public double primal(double scale) { - return loglikelihood() - KL_divergence() - c.scalePT * l1lmax(); + return loglikelihood() - KL_divergence() - scale * l1lmax(); } } -- cgit v1.2.3