diff options
author | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-25 02:14:41 +0000 |
---|---|---|
committer | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-25 02:14:41 +0000 |
commit | 0ef9ee63a44bf2659756eb2f1d34f5fddfb458a4 (patch) | |
tree | bd79d681a5919da99575a0af194ea5a35b05bbdd /decoder | |
parent | 1090a065dc48211dd71f4980cf8ff34e47333ad0 (diff) |
crp with explicit table tracking
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@618 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/cdec.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/decoder/cdec.cc b/decoder/cdec.cc index ca6284f6..f7b06aa4 100644 --- a/decoder/cdec.cc +++ b/decoder/cdec.cc @@ -266,8 +266,8 @@ void InitCommandLine(int argc, char** argv, OracleBleu &ob, po::variables_map* c } // TODO move out of cdec into some sampling decoder file -void SampleRecurse(const Hypergraph& hg, const vector<SampleSet>& ss, int n, vector<WordID>* out) { - const SampleSet& s = ss[n]; +void SampleRecurse(const Hypergraph& hg, const vector<SampleSet<prob_t> >& ss, int n, vector<WordID>* out) { + const SampleSet<prob_t>& s = ss[n]; int i = rng->SelectSample(s); const Hypergraph::Edge& edge = hg.edges_[hg.nodes_[n].in_edges_[i]]; vector<vector<WordID> > ants(edge.tail_nodes_.size()); @@ -290,9 +290,9 @@ void MaxTranslationSample(Hypergraph* hg, const int samples, const int k) { unordered_map<string, int, boost::hash<string> > m; hg->PushWeightsToGoal(); const int num_nodes = hg->nodes_.size(); - vector<SampleSet> ss(num_nodes); + vector<SampleSet<prob_t> > ss(num_nodes); for (int i = 0; i < num_nodes; ++i) { - SampleSet& s = ss[i]; + SampleSet<prob_t>& s = ss[i]; const vector<int>& in_edges = hg->nodes_[i].in_edges_; for (int j = 0; j < in_edges.size(); ++j) { s.add(hg->edges_[in_edges[j]].edge_prob_); |