From 9b2da83a560931baab56b73214793b8b664a2689 Mon Sep 17 00:00:00 2001 From: graehl Date: Sun, 18 Jul 2010 23:33:03 +0000 Subject: boost cmd line notify(conf) was missing git-svn-id: https://ws10smt.googlecode.com/svn/trunk@313 ec762483-ff6d-05da-a07a-a48fb63a330f --- vest/mr_vest_generate_mapper_input.cc | 37 ++++++++++++++++++++--------------- vest/scorer.cc | 2 +- 2 files changed, 22 insertions(+), 17 deletions(-) (limited to 'vest') diff --git a/vest/mr_vest_generate_mapper_input.cc b/vest/mr_vest_generate_mapper_input.cc index 50e620f8..ac826ecf 100644 --- a/vest/mr_vest_generate_mapper_input.cc +++ b/vest/mr_vest_generate_mapper_input.cc @@ -33,13 +33,16 @@ typedef SparseVector Dir; typedef Dir Point; -void compress_similar(vector &dirs,double min_dist,ostream *log=&cerr,bool avg=true) { +void compress_similar(vector &dirs,double min_dist,ostream *log=&cerr,bool avg=true,bool verbose=true) { + // return; //TODO: debug if (min_dist<=0) return; double max_s=1.-min_dist; + if (log&&verbose) *log<<"max allowed S="< "< &dirs,double min_dist,ostream *log=&cerr,bool swap(dirs[j],dirs[--N]); } } + if (log&&verbose) *log<(); forest_repository = (*conf)["forest_repository"].as(); weights_file = (*conf)["weights"].as(); n_random = (*conf)["random_directions"].as(); + } } int main(int argc, char *argv[]) { @@ -134,8 +143,8 @@ struct oracle_directions { void Run() { AddPrimaryAndRandomDirections(); - //AddOracleDirections(); - //compress_similar(directions,max_similarity); + AddOracleDirections(); + compress_similar(directions,max_similarity); Print(); } @@ -143,25 +152,21 @@ struct oracle_directions { Point origin; // old weights that gave model 1best. vector optimize_features; void UseConf(po::variables_map const& conf) { -#if 0 oracle.UseConf(conf); - + // po::value(&var) takes care of below: + // fear_to_hope=conf.count("fear_to_hope"); + // n_random=conf["random_directions"].as(); + // forest_repository=conf["forest_repository"].as(); + // dev_set_size=conf["dev_set_size"].as(); + // n_oracle=conf["oracle_directions"].as(); + // oracle_batch=conf["oracle_batch"].as(); + // max_similarity=conf["max_similarity"].as(); + // weights_file=conf["weights"].as(); include_primary=!conf.count("no_primary"); old_to_hope=!conf.count("no_old_to_hope"); if (conf.count("optimize_feature") > 0) optimize_features=conf["optimize_feature"].as >(); - - // po::value(&var) takes care of below: -// fear_to_hope=conf.count("fear_to_hope"); -// n_random=conf["random_directions"].as(); -// forest_repository=conf["forest_repository"].as(); -// dev_set_size=conf["dev_set_size"].as(); -// n_oracle=conf["oracle_directions"].as(); -// oracle_batch=conf["oracle_batch"].as(); -// max_similarity=conf["max_similarity"].as(); -// weights_file=conf["weights"].as(); -#endif Init(); } diff --git a/vest/scorer.cc b/vest/scorer.cc index 8f981af6..30015bb2 100644 --- a/vest/scorer.cc +++ b/vest/scorer.cc @@ -44,7 +44,7 @@ ScoreType ScoreTypeFromString(const string& st) { return Koehn_BLEU; if (sl == "combi") return BLEU_minus_TER_over_2; - cerr << "Don't understand score type '" << sl << "', defaulting to ibm_bleu.\n"; + cerr << "Don't understand score type '" << st << "', defaulting to ibm_bleu.\n"; return IBM_BLEU; } -- cgit v1.2.3