From a753ce95a0c285952fd64d658f2bd4a5c5db8e4c Mon Sep 17 00:00:00 2001 From: desaicwtf Date: Mon, 12 Jul 2010 18:54:12 +0000 Subject: agreement model prints llh, distance and objective git-svn-id: https://ws10smt.googlecode.com/svn/trunk@225 ec762483-ff6d-05da-a07a-a48fb63a330f --- .../prjava/src/phrase/Agree.java | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'gi/posterior-regularisation/prjava/src/phrase') diff --git a/gi/posterior-regularisation/prjava/src/phrase/Agree.java b/gi/posterior-regularisation/prjava/src/phrase/Agree.java index 1d56cf18..d5b949b0 100644 --- a/gi/posterior-regularisation/prjava/src/phrase/Agree.java +++ b/gi/posterior-regularisation/prjava/src/phrase/Agree.java @@ -17,8 +17,14 @@ public class Agree { Corpus c; private int K,n_phrases, n_words, n_contexts, n_positions1,n_positions2; - private double llh; - + /**@brief sum of loglikelihood of two + * individual models + */ + public double llh; + /**@brief Bhattacharyya distance + * + */ + public double bdist; /** * * @param numCluster @@ -60,10 +66,11 @@ public class Agree { Agree agree=new Agree(numCluster, corpus); int iter=20; - double llh=0; for(int i=0;i 0; - llh += edge.getCount() * Math.log(z); + bdist += edge.getCount() * Math.log(z); arr.F.l1normalize(p); int count = edge.getCount(); @@ -147,7 +154,6 @@ public class Agree { arr.F.l1normalize(j); } - model1.emit=exp_emit1; model1.pi=exp_pi1; model2.emit=exp_emit2; -- cgit v1.2.3