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
commitc0b9b8a066ff72711348720d54394088c75f35ec (patch)
tree8409d71bb2773cb632bd5b81c5b3afb7e8e2e4e4 /gi/posterior-regularisation/train_pr_global.py
parent49f18f61b6b4b8c347ef948934f349b1c1421015 (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]