summaryrefslogtreecommitdiff
path: root/gi/posterior-regularisation/prjava/src/phrase/Trainer.java
diff options
context:
space:
mode:
authortrevor.cohn <trevor.cohn@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-14 15:15:35 +0000
committertrevor.cohn <trevor.cohn@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-14 15:15:35 +0000
commitd2a54056e2acbdfd48e7c088fe25cc24cf280575 (patch)
tree73589c6900293e34f12a3070ec80bef3398c9a99 /gi/posterior-regularisation/prjava/src/phrase/Trainer.java
parentc29321deae3bc178e9ea0501f598a40894c6bc98 (diff)
Made PhraseObjective thread safe
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@248 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi/posterior-regularisation/prjava/src/phrase/Trainer.java')
-rw-r--r--gi/posterior-regularisation/prjava/src/phrase/Trainer.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/gi/posterior-regularisation/prjava/src/phrase/Trainer.java b/gi/posterior-regularisation/prjava/src/phrase/Trainer.java
index 240c4d64..20f6c905 100644
--- a/gi/posterior-regularisation/prjava/src/phrase/Trainer.java
+++ b/gi/posterior-regularisation/prjava/src/phrase/Trainer.java
@@ -31,6 +31,7 @@ public class Trainer
parser.accepts("alpha-emit").withRequiredArg().ofType(Double.class).defaultsTo(0.1);
parser.accepts("alpha-pi").withRequiredArg().ofType(Double.class).defaultsTo(0.01);
parser.accepts("agree");
+ parser.accepts("no-parameter-cache");
OptionSet options = parser.parse(args);
if (options.has("help") || !options.has("in"))
@@ -96,6 +97,8 @@ public class Trainer
cluster = new PhraseCluster(tags, corpus);
if (threads > 0) cluster.useThreadPool(threads);
if (vb) cluster.initialiseVB(alphaEmit, alphaPi);
+ if (options.has("no-parameter-cache"))
+ cluster.cacheLambda = false;
}
double last = 0;