summaryrefslogtreecommitdiff
path: root/decoder/hg.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-03-22 14:44:46 -0400
committerChris Dyer <cdyer@cs.cmu.edu>2011-03-22 14:44:46 -0400
commitc0ae6f362b245ccf2ab3b8d6dc7e367cbcc64c1c (patch)
tree1f24d437285147f08d8dd868dc1cb217e208c931 /decoder/hg.cc
parent4bc9ea17ba9f85c899e35a9d657ee3f174ff2863 (diff)
fix local normalizer code for summary features
Diffstat (limited to 'decoder/hg.cc')
-rw-r--r--decoder/hg.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/decoder/hg.cc b/decoder/hg.cc
index 39ac5132..a4028b0e 100644
--- a/decoder/hg.cc
+++ b/decoder/hg.cc
@@ -226,9 +226,9 @@ prob_t Hypergraph::PushViterbiWeightsToGoal(int fid) {
}
-void Hypergraph::PushWeightsToGoal(double scale) {
+prob_t Hypergraph::PushWeightsToGoal(double scale) {
vector<prob_t> posts;
- ComputeEdgePosteriors(scale, &posts);
+ const prob_t inside_z = ComputeEdgePosteriors(scale, &posts);
for (int i = 0; i < nodes_.size(); ++i) {
const Hypergraph::Node& node = nodes_[i];
prob_t z = prob_t::Zero();
@@ -238,6 +238,7 @@ void Hypergraph::PushWeightsToGoal(double scale) {
edges_[node.in_edges_[j]].edge_prob_ = posts[node.in_edges_[j]] / z;
}
}
+ return inside_z;
}
struct EdgeExistsWeightFunction {