diff options
author | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-09-28 17:06:08 +0000 |
---|---|---|
committer | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-09-28 17:06:08 +0000 |
commit | 66ff975d0bd25f564a82d124cdbd984bda0ea417 (patch) | |
tree | 6a8d2a9a4594cf251260c866c46c15479452696d /decoder/decoder.cc | |
parent | f678837bfee1f97a0910626a5356ba9e2b8c6371 (diff) |
use boost mpi, fix L1 stochastic optimizer
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@659 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/decoder.cc')
-rw-r--r-- | decoder/decoder.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/decoder/decoder.cc b/decoder/decoder.cc index 1a233fc5..537fdffa 100644 --- a/decoder/decoder.cc +++ b/decoder/decoder.cc @@ -147,6 +147,7 @@ struct DecoderImpl { void SetWeights(const vector<double>& weights) { feature_weights = weights; } + void SetId(int next_sent_id) { sent_id = next_sent_id - 1; } void forest_stats(Hypergraph &forest,string name,bool show_tree,bool show_features,WeightVector *weights=0,bool show_deriv=false) { cerr << viterbi_stats(forest,name,true,show_tree,show_deriv); @@ -622,6 +623,7 @@ DecoderImpl::DecoderImpl(po::variables_map& conf, int argc, char** argv, istream Decoder::Decoder(istream* cfg) { pimpl_.reset(new DecoderImpl(conf,0,0,cfg)); } Decoder::Decoder(int argc, char** argv) { pimpl_.reset(new DecoderImpl(conf,argc, argv, 0)); } Decoder::~Decoder() {} +void Decoder::SetId(int next_sent_id) { pimpl_->SetId(next_sent_id); } bool Decoder::Decode(const string& input, DecoderObserver* o) { bool del = false; if (!o) { o = new DecoderObserver; del = true; } @@ -818,8 +820,7 @@ bool DecoderImpl::Decode(const string& input, DecoderObserver* o) { HypergraphIO::WriteAsCFG(forest); if (has_ref) { if (HG::Intersect(ref, &forest)) { - if (!SILENT) cerr << " Constr. forest (nodes/edges): " << forest.nodes_.size() << '/' << forest.edges_.size() << endl; - if (!SILENT) cerr << " Constr. forest (paths): " << forest.NumberOfPaths() << endl; + if (!SILENT) forest_stats(forest," Constr. forest",show_tree_structure,show_features,feature_weights,oracle.show_derivation); if (crf_uniform_empirical) { if (!SILENT) cerr << " USING UNIFORM WEIGHTS\n"; for (int i = 0; i < forest.edges_.size(); ++i) |