Skip to content
Snippets Groups Projects
Commit 0498d149 authored by Franck Dary's avatar Franck Dary
Browse files

Fixed randomDebug and increased history size

parent 8b6ba7d9
No related branches found
No related tags found
No related merge requests found
...@@ -28,12 +28,18 @@ void Trainer::setDebugValue() ...@@ -28,12 +28,18 @@ void Trainer::setDebugValue()
if (!ProgramParameters::randomDebug) if (!ProgramParameters::randomDebug)
return; return;
ProgramParameters::debug = choiceWithProbability(ProgramParameters::randomDebugProbability);
if (!ProgramParameters::debug)
return;
if (ProgramParameters::interactive) if (ProgramParameters::interactive)
fprintf(stderr, " \r"); fprintf(stderr, " \r");
fprintf(stderr, "\n");
if (ProgramParameters::printTime) if (ProgramParameters::printTime)
fprintf(stderr, "[%s] :\n", getTime().c_str()); fprintf(stderr, "[%s] :\n", getTime().c_str());
ProgramParameters::debug = choiceWithProbability(ProgramParameters::randomDebugProbability);
} }
void Trainer::computeScoreOnDev() void Trainer::computeScoreOnDev()
...@@ -58,6 +64,7 @@ void Trainer::computeScoreOnDev() ...@@ -58,6 +64,7 @@ void Trainer::computeScoreOnDev()
while (!devConfig->isFinal()) while (!devConfig->isFinal())
{ {
setDebugValue();
devConfig->setCurrentStateName(tm.getCurrentState()); devConfig->setCurrentStateName(tm.getCurrentState());
Dict::currentClassifierName = tm.getCurrentClassifier()->name; Dict::currentClassifierName = tm.getCurrentClassifier()->name;
tm.getCurrentClassifier()->initClassifier(*devConfig); tm.getCurrentClassifier()->initClassifier(*devConfig);
...@@ -464,6 +471,7 @@ void Trainer::train() ...@@ -464,6 +471,7 @@ void Trainer::train()
resetAndShuffle(); resetAndShuffle();
while (!trainConfig.isFinal()) while (!trainConfig.isFinal())
{ {
setDebugValue();
trainConfig.setCurrentStateName(tm.getCurrentState()); trainConfig.setCurrentStateName(tm.getCurrentState());
Dict::currentClassifierName = tm.getCurrentClassifier()->name; Dict::currentClassifierName = tm.getCurrentClassifier()->name;
tm.getCurrentClassifier()->initClassifier(trainConfig); tm.getCurrentClassifier()->initClassifier(trainConfig);
......
...@@ -134,7 +134,7 @@ class Config ...@@ -134,7 +134,7 @@ class Config
private : private :
const unsigned int HISTORY_SIZE = 1000000; const unsigned int HISTORY_SIZE = 100000000;
/// @brief The name of the current state of the TransitionMachine. /// @brief The name of the current state of the TransitionMachine.
std::string currentStateName; std::string currentStateName;
/// @brief For each state of the TransitionMachine, an history of the Action that have been applied to this Config. /// @brief For each state of the TransitionMachine, an history of the Action that have been applied to this Config.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment