From 0498d14923566da99b84099bc868a14ff6feae8a Mon Sep 17 00:00:00 2001 From: Franck Dary <franck.dary@lis-lab.fr> Date: Tue, 7 May 2019 12:21:12 +0200 Subject: [PATCH] Fixed randomDebug and increased history size --- trainer/src/Trainer.cpp | 12 ++++++++++-- transition_machine/include/Config.hpp | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/trainer/src/Trainer.cpp b/trainer/src/Trainer.cpp index f33d538..1c8ed8a 100644 --- a/trainer/src/Trainer.cpp +++ b/trainer/src/Trainer.cpp @@ -28,12 +28,18 @@ void Trainer::setDebugValue() if (!ProgramParameters::randomDebug) return; + ProgramParameters::debug = choiceWithProbability(ProgramParameters::randomDebugProbability); + + if (!ProgramParameters::debug) + return; + if (ProgramParameters::interactive) fprintf(stderr, " \r"); + + fprintf(stderr, "\n"); + if (ProgramParameters::printTime) fprintf(stderr, "[%s] :\n", getTime().c_str()); - - ProgramParameters::debug = choiceWithProbability(ProgramParameters::randomDebugProbability); } void Trainer::computeScoreOnDev() @@ -58,6 +64,7 @@ void Trainer::computeScoreOnDev() while (!devConfig->isFinal()) { + setDebugValue(); devConfig->setCurrentStateName(tm.getCurrentState()); Dict::currentClassifierName = tm.getCurrentClassifier()->name; tm.getCurrentClassifier()->initClassifier(*devConfig); @@ -464,6 +471,7 @@ void Trainer::train() resetAndShuffle(); while (!trainConfig.isFinal()) { + setDebugValue(); trainConfig.setCurrentStateName(tm.getCurrentState()); Dict::currentClassifierName = tm.getCurrentClassifier()->name; tm.getCurrentClassifier()->initClassifier(trainConfig); diff --git a/transition_machine/include/Config.hpp b/transition_machine/include/Config.hpp index 604d9ea..de3dd7a 100644 --- a/transition_machine/include/Config.hpp +++ b/transition_machine/include/Config.hpp @@ -134,7 +134,7 @@ class Config private : - const unsigned int HISTORY_SIZE = 1000000; + const unsigned int HISTORY_SIZE = 100000000; /// @brief The name of the current state of the TransitionMachine. std::string currentStateName; /// @brief For each state of the TransitionMachine, an history of the Action that have been applied to this Config. -- GitLab