summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorgraehl@gmail.com <graehl@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-09 06:18:42 +0000
committergraehl@gmail.com <graehl@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-09 06:18:42 +0000
commit91727ef8fa46ffda8a6dd9a70d2e9b707f098402 (patch)
tree385ce7943caeea5683a550171802923433cc3c4c /decoder
parent42dcac486a1556060c79a37192d862e52e2feb46 (diff)
ComputeEdgeViterbi
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@495 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder')
-rw-r--r--decoder/hg.cc4
-rw-r--r--decoder/viterbi.cc2
-rw-r--r--decoder/weights-fsa13
3 files changed, 17 insertions, 2 deletions
diff --git a/decoder/hg.cc b/decoder/hg.cc
index 1e2a0010..8a6c8228 100644
--- a/decoder/hg.cc
+++ b/decoder/hg.cc
@@ -70,7 +70,9 @@ prob_t Hypergraph::ComputeEdgeViterbi(EdgeProbs *ev) const {
}
prob_t Hypergraph::ComputeEdgeViterbi(NodeProbs const& nv,EdgeProbs *ev) const {
- for (int i=0;i<edges_.size();++i) {
+ int ne=edges_.size();
+ ev->resize(ne);
+ for (int i=0;i<ne;++i) {
Edge const& e=edges_[i];
prob_t r=e.edge_prob_;
TailNodeVector const& t=e.tail_nodes_;
diff --git a/decoder/viterbi.cc b/decoder/viterbi.cc
index 6bcc97db..c8322823 100644
--- a/decoder/viterbi.cc
+++ b/decoder/viterbi.cc
@@ -29,7 +29,7 @@ std::string viterbi_stats(Hypergraph const& hg, std::string const& name, bool es
}
#ifdef DEBUG_VITERBI_SORT
const_cast<Hypergraph&>(hg).ViterbiSortInEdges();
- o<<name<<" (viterbi sort) first derivation: ";
+ o<<name<<" sorted #1 derivation: ";
o<<hg.show_first_tree(false);
o<<endl;
#endif
diff --git a/decoder/weights-fsa b/decoder/weights-fsa
new file mode 100644
index 00000000..fe01d13a
--- /dev/null
+++ b/decoder/weights-fsa
@@ -0,0 +1,13 @@
+Arity_0 1.70741473606976
+Arity_1 1.12426238048012
+Arity_2 1.14986187839554
+Glue -0.04589037041388
+LanguageModel 1.09051
+PassThrough -3.66226367902928
+PhraseModel_0 -1.94633451863252
+PhraseModel_1 -0.1475347695476
+PhraseModel_2 -1.614818994946
+WordPenalty -3.0
+WordPenaltyFsa -0.56028442964748
+ShorterThanPrev -10
+LongerThanPrev -10