From 2f90f9e203da01583ee0b82d4769f25b198835dd 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') 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