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

Fixed previous commit

parent f5196710
No related branches found
No related tags found
No related merge requests found
......@@ -65,13 +65,20 @@ void Trainer::computeScoreOnDev()
auto weightedActions = tm.getCurrentClassifier()->weightActions(*devConfig);
std::string pAction = "";
std::string oAction = "";
for (auto & it : weightedActions)
if (it.first)
{
if (pAction.empty())
pAction = it.second.second;
if (tm.getCurrentClassifier()->getActionCost(trainConfig, it.second.second) == 0)
{
oAction = it.second.second;
break;
}
}
bool pActionIsZeroCost = tm.getCurrentClassifier()->getActionCost(*devConfig, pAction) == 0;
......@@ -80,15 +87,12 @@ void Trainer::computeScoreOnDev()
TI.addDevSuccess(tm.getCurrentClassifier()->name);
std::string actionName;
if (ProgramParameters::devEvalOnGold)
{
int neededActionIndex = tm.getCurrentClassifier()->getOracleActionIndex(*devConfig);
actionName = tm.getCurrentClassifier()->getActionName(neededActionIndex);
}
actionName = oAction;
else
{
actionName = pAction;
}
Action * action = tm.getCurrentClassifier()->getAction(actionName);
if (ProgramParameters::debug)
......@@ -280,7 +284,6 @@ void Trainer::train()
std::string actionName = "";
//ici
if (ProgramParameters::featureExtraction)
{
auto features = tm.getCurrentClassifier()->getFeatureModel()->getFeatureDescription(trainConfig).featureValues();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment