summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--training/dtrain/dtrain_net_interface.cc5
-rw-r--r--training/dtrain/dtrain_net_interface.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/training/dtrain/dtrain_net_interface.cc b/training/dtrain/dtrain_net_interface.cc
index f16b9304..77ccde55 100644
--- a/training/dtrain/dtrain_net_interface.cc
+++ b/training/dtrain/dtrain_net_interface.cc
@@ -143,7 +143,7 @@ main(int argc, char** argv)
cerr << "[dtrain] learning ..." << endl;
source = parts[0];
// debug --
- debug_output << "\"source\":\"" << source.substr(source.find_first_of(">")+1, source.find_last_of("<")-3) << "\"," << endl;
+ debug_output << "\"source\":\"" << source.substr(source.find_first_of(">")+2, source.find_last_of(">")-6) << "\"," << endl;
debug_output << "\"target\":\"" << parts[1] << "\"," << endl;
// -- debug
parts.erase(parts.begin());
@@ -198,11 +198,14 @@ main(int argc, char** argv)
// get pairs and update
SparseVector<weight_t> updates;
size_t num_up = CollectUpdates(samples, updates, margin);
+ debug_output << "\"1best_features\":\"" << (*samples)[0].f << "\"," << endl;
+ debug_output << "\"update_raw\":\"" << updates << "\"," << endl;
updates *= eta_sparse; // apply learning rate for sparse features
for (auto feat: dense_features) { // apply learning rate for dense features
updates[FD::Convert(feat)] /= eta_sparse;
updates[FD::Convert(feat)] *= eta;
}
+ debug_output << "\"update\":\"" << updates << "\"," << endl;
// debug --
debug_output << "\"num_up\":" << num_up << "," << endl;
debug_output << "\"updated_features\":" << updates.size() << "," << endl;
diff --git a/training/dtrain/dtrain_net_interface.h b/training/dtrain/dtrain_net_interface.h
index debe8800..b201c7a3 100644
--- a/training/dtrain/dtrain_net_interface.h
+++ b/training/dtrain/dtrain_net_interface.h
@@ -66,7 +66,7 @@ dtrain_net_init(int argc, char** argv, po::variables_map* conf)
("learning_rate_sparse,l", po::value<weight_t>()->default_value(0.00001), "learning rate for sparse features")
("output_derivation,E", po::bool_switch()->default_value(false), "output derivation, not viterbi str")
("output_rules,R", po::bool_switch()->default_value(false), "also output rules")
- ("dense_features,D", po::value<string>()->default_value("EgivenFCoherent SampleCountF CountEF MaxLexFgivenE MaxLexEgivenF IsSingletonF IsSingletonFE Glue WordPenalty PassThrough LanguageModel LanguageModel_OOV Shape_S01111_T11011 Shape_S11110_T11011 Shape_S11100_T11000 Shape_S01110_T01110 Shape_S01111_T01111 Shape_S01100_T11000 Shape_S10000_T10000 Shape_S11100_T11100 Shape_S11110_T11110 Shape_S11110_T11010 Shape_S01100_T11100 Shape_S01000_T01000 Shape_S01010_T01010 Shape_S01111_T01011 Shape_S01100_T01100 Shape_S01110_T11010 Shape_S11000_T11000 Shape_S11000_T01100 IsSupportedOnline ForceRule"),
+ ("dense_features,D", po::value<string>()->default_value("EgivenFCoherent SampleCountF CountEF MaxLexFgivenE MaxLexEgivenF IsSingletonF IsSingletonFE Glue WordPenalty PassThrough LanguageModel LanguageModel_OOV Shape_S01111_T11011 Shape_S11110_T11011 Shape_S11100_T11000 Shape_S01110_T01110 Shape_S01111_T01111 Shape_S01100_T11000 Shape_S10000_T10000 Shape_S11100_T11100 Shape_S11110_T11110 Shape_S11110_T11010 Shape_S01100_T11100 Shape_S01000_T01000 Shape_S01010_T01010 Shape_S01111_T01011 Shape_S01100_T01100 Shape_S01110_T11010 Shape_S11000_T11000 Shape_S11000_T01100 IsSupportedOnline NewRule KnownRule OOVFix"),
"dense features")
("debug_output,d", po::value<string>()->default_value(""), "file for debug output");
po::options_description cl("Command Line Options");