From a592b3a5ed2dc96c62d9fe7408948d66b97e1aec Mon Sep 17 00:00:00 2001
From: "trevor.cohn" <trevor.cohn@ec762483-ff6d-05da-a07a-a48fb63a330f>
Date: Wed, 21 Jul 2010 17:30:41 +0000
Subject: Little bug fix to EM clustering

git-svn-id: https://ws10smt.googlecode.com/svn/trunk@357 ec762483-ff6d-05da-a07a-a48fb63a330f
---
 gi/posterior-regularisation/prjava/src/phrase/PhraseCluster.java | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

(limited to 'gi')

diff --git a/gi/posterior-regularisation/prjava/src/phrase/PhraseCluster.java b/gi/posterior-regularisation/prjava/src/phrase/PhraseCluster.java
index 93e743fc..13ac14ba 100644
--- a/gi/posterior-regularisation/prjava/src/phrase/PhraseCluster.java
+++ b/gi/posterior-regularisation/prjava/src/phrase/PhraseCluster.java
@@ -90,10 +90,7 @@ public class PhraseCluster {
 		for(int phrase=0; phrase < n_phrases; phrase++)
 		{
 			if (phraseSizeLimit >= 1 && c.getPhrase(phrase).size() > phraseSizeLimit)
-			{
-			//	System.arraycopy(pi[phrase], 0, exp_pi[phrase], 0, K);
 				continue;
-			}	
 
 			Arrays.fill(exp_pi, 1e-10);
 			
@@ -119,8 +116,8 @@ public class PhraseCluster {
 					exp_pi[tag]+=p[tag]*count;
 				}
 			}
-			arr.F.l1norm(exp_pi);
-			pi[phrase]=exp_pi;
+			arr.F.l1normalize(exp_pi);
+			System.arraycopy(exp_pi, 0, pi[phrase], 0, K);
 		}
 
 		//M
-- 
cgit v1.2.3