summaryrefslogtreecommitdiff
path: root/training
diff options
context:
space:
mode:
Diffstat (limited to 'training')
-rw-r--r--training/dtrain/dtrain.cc2
-rw-r--r--training/dtrain/dtrain.h2
-rw-r--r--training/dtrain/sample.h2
-rw-r--r--training/dtrain/update.h8
4 files changed, 7 insertions, 7 deletions
diff --git a/training/dtrain/dtrain.cc b/training/dtrain/dtrain.cc
index e563f541..ddd27211 100644
--- a/training/dtrain/dtrain.cc
+++ b/training/dtrain/dtrain.cc
@@ -112,7 +112,7 @@ main(int argc, char** argv)
cerr << setw(25) << "learning rate " << eta << endl;
cerr << setw(25) << "margin " << margin << endl;
if (!structured) {
- cerr << setw(25) << "cut " << cut << endl;
+ cerr << setw(25) << "cut " << round(cut*100) << "%" << endl;
cerr << setw(25) << "adjust " << adjust_cut << endl;
} else {
cerr << setw(25) << "struct. obj " << structured << endl;
diff --git a/training/dtrain/dtrain.h b/training/dtrain/dtrain.h
index 18a7dbdc..b07edfdf 100644
--- a/training/dtrain/dtrain.h
+++ b/training/dtrain/dtrain.h
@@ -64,7 +64,7 @@ dtrain_init(int argc,
pair sampling, 0 to use all pairs TODO")
("adjust,A", po::bool_switch()->default_value(false),
"adjust cut for optimal pos. in k-best to cut")
- ("score,s", po::value<string>()->default_value("chiang"),
+ ("score,s", po::value<string>()->default_value("nakov"),
"per-sentence BLEU (approx.)")
("nakov_fix", po::value<weight_t>()->default_value(1.0),
"add to reference length [see score.h]")
diff --git a/training/dtrain/sample.h b/training/dtrain/sample.h
index bccc29b7..860904fd 100644
--- a/training/dtrain/sample.h
+++ b/training/dtrain/sample.h
@@ -115,7 +115,7 @@ struct KSampler : public HypSampler
effective_size++;
feature_count += sample.back().f.size();
}
- sort(sample.begin(), sample.end(), [](Hyp& first, Hyp& second) {
+ sort(sample.begin(), sample.end(), [](Hyp first, Hyp second) {
return first.model > second.model;
});
for (unsigned i=0; i<sample.size(); i++) {
diff --git a/training/dtrain/update.h b/training/dtrain/update.h
index 1c51c4f1..30b14771 100644
--- a/training/dtrain/update.h
+++ b/training/dtrain/update.h
@@ -26,7 +26,7 @@ updates_multipartite(vector<Hyp>* sample,
size_t up = 0;
size_t sz = sample->size();
if (sz < 2) return 0;
- sort(sample->begin(), sample->end(), [](Hyp& first, Hyp& second)
+ sort(sample->begin(), sample->end(), [](Hyp first, Hyp second)
{
return first.gold > second.gold;
});
@@ -95,7 +95,7 @@ updates_all(vector<Hyp>* sample,
{
size_t up = 0;
size_t sz = sample->size();
- sort(sample->begin(), sample->end(), [](Hyp& first, Hyp& second)
+ sort(sample->begin(), sample->end(), [](Hyp first, Hyp second)
{
return first.gold > second.gold;
});
@@ -129,13 +129,13 @@ update_structured(vector<Hyp>* sample,
ostream& os=cout)
{
// hope
- sort(sample->begin(), sample->end(), [](Hyp& first, Hyp& second)
+ sort(sample->begin(), sample->end(), [](Hyp first, Hyp second)
{
return (first.model+first.gold) > (second.model+second.gold);
});
Hyp hope = (*sample)[0];
// fear
- sort(sample->begin(), sample->end(), [](Hyp& first, Hyp& second)
+ sort(sample->begin(), sample->end(), [](Hyp first, Hyp second)
{
return (first.model-first.gold) > (second.model-second.gold);
});