From fb6bbeba17c56f5adf7ddcb16b445073883e1b83 Mon Sep 17 00:00:00 2001
From: Patrick Simianer
Date: Tue, 27 Sep 2011 00:12:30 +0200
Subject: tmp param
---
dtrain/dtrain.cc | 8 +++++---
dtrain/dtrain.h | 2 +-
dtrain/test/example/dtrain.ini | 7 ++++---
3 files changed, 10 insertions(+), 7 deletions(-)
(limited to 'dtrain')
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()->zero_tokens(), "run in hadoop streaming mode")
("learning_rate", po::value()->default_value(0.0005), "learning rate")
("gamma", po::value()->default_value(0.), "gamma for SVM (0 for perceptron)")
- ("tmp", po::value()->default_value("/tmp"), "temp dir to use") // FIXME
+ ("tmp", po::value()->default_value("/tmp"), "temp dir to use")
("noup", po::value()->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 src_str_buf; // source strings
vector > 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().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
+#include
#include
#include
@@ -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=./
--
cgit v1.2.3