diff options
author | trevor.cohn <trevor.cohn@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-06 16:23:11 +0000 |
---|---|---|
committer | trevor.cohn <trevor.cohn@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-06 16:23:11 +0000 |
commit | 018a9f9feb6f432fb24e7a44908f165dc405ac05 (patch) | |
tree | 3cbfee8762c34d73312cb3bcd4a20d9e549d0e88 /gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java | |
parent | 825b1fc172a4f097c94b0fe8137ba2356262b5f4 (diff) |
Thread pooling
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@151 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java')
-rw-r--r-- | gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java b/gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java index e9e063d6..71c91b96 100644 --- a/gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java +++ b/gi/posterior-regularisation/prjava/src/phrase/PhraseObjective.java @@ -22,7 +22,6 @@ public class PhraseObjective extends ProjectedObjective{ private static final double GRAD_DIFF = 0.002;
public static double INIT_STEP_SIZE=1;
public static double VAL_DIFF=0.001;
- private double scale=5;
private double c1=0.0001;
private double c2=0.9;
@@ -73,7 +72,7 @@ public class PhraseObjective extends ProjectedObjective{ newPoint = new double[n_param];
gradient = new double[n_param];
initP();
- projection=new SimplexProjection (scale);
+ projection=new SimplexProjection(c.scale);
q=new double [data.length][c.K];
setParameters(parameters);
@@ -111,8 +110,7 @@ public class PhraseObjective extends ProjectedObjective{ }
for(int edge=0;edge<data.length;edge++){
- loglikelihood+=Math.log
- (data[edge][countIdx]*arr.F.l1norm(q[edge]));
+ loglikelihood+=data[edge][countIdx] * Math.log(arr.F.l1norm(q[edge]));
arr.F.l1normalize(q[edge]);
}
@@ -222,7 +220,7 @@ public class PhraseObjective extends ProjectedObjective{ sum+=max;
}
// ps.println(", "+sum);
- l=l-scale*sum;
+ l=l-c.scale*sum;
return l;
}
|