diff options
author | graehl@gmail.com <graehl@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-09 06:18:42 +0000 |
---|---|---|
committer | graehl@gmail.com <graehl@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-09 06:18:42 +0000 |
commit | 34f88db8b11f55e736c6f85cb822c47fb18ac523 (patch) | |
tree | 735462c87da72f4b77588e02bf921038eb4003d5 /decoder | |
parent | b96f8ca79c3293062a4b24266e07859cedc936c2 (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.cc | 4 | ||||
-rw-r--r-- | decoder/viterbi.cc | 2 | ||||
-rw-r--r-- | decoder/weights-fsa | 13 |
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 |