summaryrefslogtreecommitdiff
path: root/gi/posterior-regularisation/train_pr_global.py
diff options
context:
space:
mode:
authortrevor.cohn <trevor.cohn@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-06-30 21:26:24 +0000
committertrevor.cohn <trevor.cohn@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-06-30 21:26:24 +0000
commitd59da3201bd8dce7512c3a376a915720a07cda8c (patch)
tree74577d5b6c36bf4f71a28d60ff5bb53c34b08a6d /gi/posterior-regularisation/train_pr_global.py
parent3c68e6ca0aa4116b01cce1f4a4271ef81cf9c519 (diff)
Some tweaks
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@82 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi/posterior-regularisation/train_pr_global.py')
-rw-r--r--gi/posterior-regularisation/train_pr_global.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gi/posterior-regularisation/train_pr_global.py b/gi/posterior-regularisation/train_pr_global.py
index 6ce7290d..8b80c6bc 100644
--- a/gi/posterior-regularisation/train_pr_global.py
+++ b/gi/posterior-regularisation/train_pr_global.py
@@ -263,7 +263,9 @@ for iteration in range(20):
scores[t] = conditionals[t] * exp(-lamba[li + t] - lamba[omega_offset + li + t])
z += count * sum(scores)
- tagCounts[p] += count * scores
+ for t in range(num_tags):
+ tagCounts[p][t] += count * scores[t]
+
for i in range(4):
for t in range(num_tags):
contextWordCounts[i][t][types[context[i]]] += count * scores[t]