summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2011-09-27 00:12:30 +0200
committerPatrick Simianer <p@simianer.de>2011-09-27 00:12:30 +0200
commit63fe5ea76c52f76a924f1d3df9f6bff6a2c0d93d (patch)
tree4931c7146aafe18e8eb0cf4da644e29a7fa7a4b1
parent36de7283576dd22a91577ef175c62434f3d933b4 (diff)
tmp param
-rw-r--r--dtrain/dtrain.cc8
-rw-r--r--dtrain/dtrain.h2
-rw-r--r--dtrain/test/example/dtrain.ini7
3 files changed, 10 insertions, 7 deletions
diff --git a/dtrain/dtrain.cc b/dtrain/dtrain.cc
index 622cd01e..37430fb9 100644
--- a/dtrain/dtrain.cc
+++ b/dtrain/dtrain.cc
@@ -22,7 +22,7 @@ dtrain_init(int argc, char** argv, po::variables_map* cfg)
("hstreaming", po::value<bool>()->zero_tokens(), "run in hadoop streaming mode")
("learning_rate", po::value<double>()->default_value(0.0005), "learning rate")
("gamma", po::value<double>()->default_value(0.), "gamma for SVM (0 for perceptron)")
- ("tmp", po::value<string>()->default_value("/tmp"), "temp dir to use") // FIXME
+ ("tmp", po::value<string>()->default_value("/tmp"), "temp dir to use")
("noup", po::value<bool>()->zero_tokens(), "do not update weights");
po::options_description cl("Command Line Options");
cl.add_options()
@@ -141,7 +141,9 @@ main(int argc, char** argv)
vector<string> src_str_buf; // source strings
vector<vector<WordID> > ref_ids_buf; // references as WordID vecs
// this is for writing the grammar buffer file
- char grammar_buf_fn[] = DTRAIN_TMP_DIR"/dtrain-grammars-XXXXXX";
+ char grammar_buf_fn[1024];
+ strcpy(grammar_buf_fn, cfg["tmp"].as<string>().c_str());
+ strcat(grammar_buf_fn, "/dtrain-grammars-XXXXXX");
mkstemp(grammar_buf_fn);
ogzstream grammar_buf_out;
grammar_buf_out.open(grammar_buf_fn);
@@ -337,7 +339,7 @@ main(int argc, char** argv)
++ii;
- if (hstreaming) cerr << "reporter:counter:dtrain,sid," << in_split[0] << endl;
+ if (hstreaming) cerr << "reporter:counter:dtrain,sid," << ii << endl;
} // input loop
diff --git a/dtrain/dtrain.h b/dtrain/dtrain.h
index 0c27167d..c1d910aa 100644
--- a/dtrain/dtrain.h
+++ b/dtrain/dtrain.h
@@ -3,6 +3,7 @@
#include <iomanip>
+#include <string.h>
#include <boost/algorithm/string.hpp>
#include <boost/program_options.hpp>
@@ -11,7 +12,6 @@
#include "pairsampling.h"
#define DTRAIN_DOTS 100 // when to display a '.'
-#define DTRAIN_TMP_DIR "/tmp"
#define DTRAIN_GRAMMAR_DELIM "########EOS########"
using namespace std;
diff --git a/dtrain/test/example/dtrain.ini b/dtrain/test/example/dtrain.ini
index fd3a3841..b1b9b7bd 100644
--- a/dtrain/test/example/dtrain.ini
+++ b/dtrain/test/example/dtrain.ini
@@ -1,11 +1,12 @@
decoder_config=test/example/cdec.ini
k=100
N=4
-epochs=100
+epochs=2
input=test/example/nc-1k.gz
scorer=stupid_bleu
-output=test/example/weights.gz
-stop_after=0
+output=- #test/example/weights.gz
+stop_after=2
sample_from=forest
pair_sampling=rand
print_weights=Glue WordPenalty LanguageModel LanguageModel_OOV PhraseModel_0 PhraseModel_1 PhraseModel_2 PhraseModel_3 PhraseModel_4 PassThrough
+tmp=./