From ffc37e64b3afa2d6cdb5ac7b1f41fe4e558d9b07 Mon Sep 17 00:00:00 2001 From: evahasler Date: Fri, 12 Nov 2010 15:40:53 +0000 Subject: [PATCH] normalize weights after mixing git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/branches/mira-mtm5@3707 1f5c12ca-751b-0410-a591-d2e778427230 --- mira/Main.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/mira/Main.cpp b/mira/Main.cpp index 1c1eca14b..8ccebb059 100644 --- a/mira/Main.cpp +++ b/mira/Main.cpp @@ -155,19 +155,6 @@ int main(int argc, char** argv) { startWeights.L1Normalise(); decoder->setWeights(startWeights); - // print feature function and weights - // TODO: scaling of feature functions - const vector featureFunctions = StaticData::Instance().GetTranslationSystem (TranslationSystem::DEFAULT).GetFeatureFunctions(); - for (size_t i = 0; i < featureFunctions.size(); ++i) { - cerr << "Feature functions: " << featureFunctions[i]->GetScoreProducerDescription() << ": " << featureFunctions[i]->GetNumScoreComponents() << endl; - vector< float> weights = startWeights.GetScoresForProducer(featureFunctions[i]); - cerr << "weights: "; - for (size_t j = 0; j < weights.size(); ++j) { - cerr << weights[j] << " "; - } - cerr << endl; - } - // Optionally shuffle the sentences vector order; if (rank == 0) { @@ -227,6 +214,7 @@ int main(int argc, char** argv) { // the result of accumulating and averaging weights over one epoch and possibly several processes ScoreComponentCollection averageTotalWeights; + // TODO: scaling of feature values for probabilistic features // TODO: stop MIRA when score on dev or tuning set does not improve further? for (size_t epoch = 0; epoch < epochs; ++epoch) { cerr << "\nEpoch " << epoch << endl; @@ -252,7 +240,7 @@ int main(int argc, char** argv) { vector > featureValues(batchSize); vector > bleuScores(batchSize); - cout << "Using weights:" << decoder->getWeights() << endl; + cerr << "Using weights:" << decoder->getWeights() << endl; // MODEL cerr << "Run decoder to get nbest wrt model score" << endl;