Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mira
diff options
context:
space:
mode:
authorEva Hasler <evahasler@gmail.com>2012-04-03 18:41:15 +0400
committerEva Hasler <evahasler@gmail.com>2012-04-03 18:41:15 +0400
commit9480ab6bad06a5ef4390f451ced8ef7a2773bebf (patch)
tree394f9436607ec732e086cdd6f086f6bd658e0c57 /mira
parent8560a19823ce405cb6e0dc5d0e530e7d7048a1a3 (diff)
move declaration of output files, separate params --print-feature-counts, --print-nbest-with-features
Diffstat (limited to 'mira')
-rw-r--r--mira/Main.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/mira/Main.cpp b/mira/Main.cpp
index a8f402fd3..349f41e23 100644
--- a/mira/Main.cpp
+++ b/mira/Main.cpp
@@ -601,6 +601,21 @@ int main(int argc, char** argv) {
ScoreComponentCollection mixedAverageWeightsPrevious;
ScoreComponentCollection mixedAverageWeightsBeforePrevious;
+ // log feature counts and/or hope/fear translations with features
+ string f1 = "decode_hope_epoch0";
+ string f2 = "decode_fear_epoch0";
+ string s1 = "sparse_feature_hope_counts";
+ string s2 = "sparse_feature_fear_counts";
+ ofstream hopePlusFeatures(f1.c_str());
+ ofstream fearPlusFeatures(f2.c_str());
+ ofstream sparseFeatureCountsHope(s1.c_str());
+ ofstream sparseFeatureCountsFear(s2.c_str());
+ if (!hopePlusFeatures || !fearPlusFeatures || !sparseFeatureCountsHope || !sparseFeatureCountsFear) {
+ ostringstream msg;
+ msg << "Unable to open file";
+ throw runtime_error(msg.str());
+ }
+
bool stop = false;
// int sumStillViolatedConstraints;
for (size_t epoch = 0; epoch < epochs && !stop; ++epoch) {
@@ -618,20 +633,6 @@ int main(int argc, char** argv) {
size_t weightMixingThisEpoch = 0;
size_t weightEpochDump = 0;
- string f1 = "decode_hope_epoch0";
- string f2 = "decode_fear_epoch0";
- string s1 = "sparse_feature_hope_counts";
- string s2 = "sparse_feature_fear_counts";
- ofstream hopePlusFeatures(f1.c_str());
- ofstream fearPlusFeatures(f2.c_str());
- ofstream sparseFeatureCountsHope(s1.c_str());
- ofstream sparseFeatureCountsFear(s2.c_str());
- if (!hopePlusFeatures || !fearPlusFeatures) {
- ostringstream msg;
- msg << "Unable to open file";
- throw runtime_error(msg.str());
- }
-
size_t shardPosition = 0;
vector<size_t>::const_iterator sid = shard.begin();
while (sid != shard.end()) {