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

Fixed previous commit

parent f5196710
Branches
No related tags found
No related merge requests found
...@@ -65,13 +65,20 @@ void Trainer::computeScoreOnDev() ...@@ -65,13 +65,20 @@ void Trainer::computeScoreOnDev()
auto weightedActions = tm.getCurrentClassifier()->weightActions(*devConfig); auto weightedActions = tm.getCurrentClassifier()->weightActions(*devConfig);
std::string pAction = ""; std::string pAction = "";
std::string oAction = "";
for (auto & it : weightedActions) for (auto & it : weightedActions)
if (it.first) if (it.first)
{ {
if (pAction.empty())
pAction = it.second.second; pAction = it.second.second;
if (tm.getCurrentClassifier()->getActionCost(trainConfig, it.second.second) == 0)
{
oAction = it.second.second;
break; break;
} }
}
bool pActionIsZeroCost = tm.getCurrentClassifier()->getActionCost(*devConfig, pAction) == 0; bool pActionIsZeroCost = tm.getCurrentClassifier()->getActionCost(*devConfig, pAction) == 0;
...@@ -80,15 +87,12 @@ void Trainer::computeScoreOnDev() ...@@ -80,15 +87,12 @@ void Trainer::computeScoreOnDev()
TI.addDevSuccess(tm.getCurrentClassifier()->name); TI.addDevSuccess(tm.getCurrentClassifier()->name);
std::string actionName; std::string actionName;
if (ProgramParameters::devEvalOnGold) if (ProgramParameters::devEvalOnGold)
{ actionName = oAction;
int neededActionIndex = tm.getCurrentClassifier()->getOracleActionIndex(*devConfig);
actionName = tm.getCurrentClassifier()->getActionName(neededActionIndex);
}
else else
{
actionName = pAction; actionName = pAction;
}
Action * action = tm.getCurrentClassifier()->getAction(actionName); Action * action = tm.getCurrentClassifier()->getAction(actionName);
if (ProgramParameters::debug) if (ProgramParameters::debug)
...@@ -280,7 +284,6 @@ void Trainer::train() ...@@ -280,7 +284,6 @@ void Trainer::train()
std::string actionName = ""; std::string actionName = "";
//ici
if (ProgramParameters::featureExtraction) if (ProgramParameters::featureExtraction)
{ {
auto features = tm.getCurrentClassifier()->getFeatureModel()->getFeatureDescription(trainConfig).featureValues(); 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