diff options
Diffstat (limited to 'training/dtrain')
-rw-r--r-- | training/dtrain/Makefile.am | 1 | ||||
-rw-r--r-- | training/dtrain/dtrain_net_interface.cc | 24 | ||||
-rw-r--r-- | training/dtrain/dtrain_net_interface.h | 1 |
3 files changed, 20 insertions, 6 deletions
diff --git a/training/dtrain/Makefile.am b/training/dtrain/Makefile.am index db36d0f6..d22a8594 100644 --- a/training/dtrain/Makefile.am +++ b/training/dtrain/Makefile.am @@ -7,6 +7,7 @@ dtrain_net_SOURCES = dtrain_net.cc dtrain_net.h dtrain.h sample.h score.h update dtrain_net_LDADD = ../../decoder/libcdec.a ../../klm/search/libksearch.a ../../mteval/libmteval.a ../../utils/libutils.a ../../klm/lm/libklm.a ../../klm/util/libklm_util.a ../../klm/util/double-conversion/libklm_util_double.a /srv/postedit/lib/nanomsg-0.5-beta/lib/libnanomsg.so dtrain_net_interface_SOURCES = dtrain_net_interface.cc dtrain_net_interface.h dtrain.h sample_net_interface.h score_net_interface.h update.h +dtrain_net_interface_LDFLAGS = -rdynamic dtrain_net_interface_LDADD = ../../decoder/libcdec.a ../../klm/search/libksearch.a ../../mteval/libmteval.a ../../utils/libutils.a ../../klm/lm/libklm.a ../../klm/util/libklm_util.a ../../klm/util/double-conversion/libklm_util_double.a /srv/postedit/lib/nanomsg-0.5-beta/lib/libnanomsg.so AM_CPPFLAGS = -W -Wall -Wno-sign-compare -I$(top_srcdir)/utils -I$(top_srcdir)/decoder -I$(top_srcdir)/mteval -I/srv/postedit/lib/nanomsg-0.5-beta/include -I/srv/postedit/lib/cppnanomsg diff --git a/training/dtrain/dtrain_net_interface.cc b/training/dtrain/dtrain_net_interface.cc index ac447517..696348d4 100644 --- a/training/dtrain/dtrain_net_interface.cc +++ b/training/dtrain/dtrain_net_interface.cc @@ -7,6 +7,14 @@ #include <nanomsg/pair.h> #include "nn.hpp" +#include <sys/types.h> // mkfifo +#include <sys/stat.h> +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <fcntl.h> + + using namespace dtrain; int @@ -28,6 +36,16 @@ main(int argc, char** argv) const bool output_derivation = conf["output_derivation"].as<bool>(); const bool output_rules = conf["output_rules"].as<bool>(); + // update lm + /*if (conf["update_lm_fn"].as<string>() != "") + mkfifo(conf["update_lm_fn"].as<string>().c_str(), 0666);*/ + + // setup socket + nn::socket sock(AF_SP, NN_PAIR); + sock.bind(master_addr.c_str()); + string hello = "hello"; + sock.send(hello.c_str(), hello.size()+1, 0); + // setup decoder register_feature_functions(); SetSilent(true); @@ -76,12 +94,6 @@ main(int argc, char** argv) cerr << setw(25) << "learning rate RB " << learning_rate_RB << endl; cerr << setw(25) << "learning rate Shape " << learning_rate_Shape << endl; - // setup socket - nn::socket sock(AF_SP, NN_PAIR); - sock.bind(master_addr.c_str()); - string hello = "hello"; - sock.send(hello.c_str(), hello.size()+1, 0); - // debug ostringstream debug_output; diff --git a/training/dtrain/dtrain_net_interface.h b/training/dtrain/dtrain_net_interface.h index 720c4c9b..91c2e538 100644 --- a/training/dtrain/dtrain_net_interface.h +++ b/training/dtrain/dtrain_net_interface.h @@ -97,6 +97,7 @@ dtrain_net_init(int argc, char** argv, po::variables_map* conf) ("learning_rate_Shape", po::value<weight_t>(), "learning rate for shape 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") + ("update_lm_fn", po::value<string>()->default_value(""), "TODO") ("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"); |