diff options
Diffstat (limited to 'gi/posterior-regularisation/prjava')
| -rw-r--r-- | gi/posterior-regularisation/prjava/src/phrase/PhraseContextObjective.java | 8 | ||||
| -rw-r--r-- | gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java | 1 | 
2 files changed, 9 insertions, 0 deletions
| diff --git a/gi/posterior-regularisation/prjava/src/phrase/PhraseContextObjective.java b/gi/posterior-regularisation/prjava/src/phrase/PhraseContextObjective.java index a9d3529c..7e6c7f60 100644 --- a/gi/posterior-regularisation/prjava/src/phrase/PhraseContextObjective.java +++ b/gi/posterior-regularisation/prjava/src/phrase/PhraseContextObjective.java @@ -76,6 +76,7 @@ public class PhraseContextObjective extends ProjectedObjective  		if (parameters == null)
  			parameters = new double[n_param];
 +		System.out.println("Num parameters " + n_param);
  		newPoint = new double[n_param];
  		gradient = new double[n_param];
  		initP();
 @@ -112,6 +113,8 @@ public class PhraseContextObjective extends ProjectedObjective  	{
  		updateCalls++;
  		loglikelihood=0;
 +		System.out.print(".");
 +		System.out.flush();
  		long begin = System.currentTimeMillis();
  		for (int e=0; e<data.size(); e++) 
 @@ -153,6 +156,9 @@ public class PhraseContextObjective extends ProjectedObjective  	{
  		long begin = System.currentTimeMillis();
  		List<Future<?>> tasks = new ArrayList<Future<?>>();
 +		
 +		System.out.print(",");
 +		System.out.flush();
  		//System.out.println("\t\tprojectPoint: " + Arrays.toString(point));
  		Arrays.fill(newPoint, 0, newPoint.length, 0);
 @@ -337,6 +343,8 @@ public class PhraseContextObjective extends ProjectedObjective  		updateFunction();
  		boolean success = optimizer.optimize(this,stats,compositeStop);
  //		System.out.println("Ended optimzation Projected Gradient Descent\n" + stats.prettyPrint(1));
 +
 +		System.out.println();
  		if (success)
  			System.out.print("\toptimization took " + optimizer.getCurrentIteration() + " iterations");
 diff --git a/gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java b/gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java index 0e2ab4b9..e62b62f4 100644 --- a/gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java +++ b/gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java @@ -69,6 +69,7 @@ public class PhraseObjective extends ProjectedObjective  		c=cluster;
  		data=c.c.getEdgesForPhrase(phrase);
  		n_param=data.size()*c.K;
 +		//System.out.println("Num parameters " + n_param + " for phrase #" + phraseIdx);
  		if (lambda==null){
  			lambda=new double[c.c.getNumPhrases()][];
 | 
