s_model.build(f_xml.getLabelCutoff(0), f_xml.getFeatureCutoff(0));
s_model.printInfo(log);
int[] indices = UTArray.range(s_model.getInstanceSize());
Random rand = new Random(randomSeed);
AbstractEval eval = new POSEval();
double prevScore, currScore = 0;
FloatArrayList prevWeights;
String[] goldLabels;
int iter = 1;
do
{
prevScore = currScore;
prevWeights = s_model.cloneWeights();
UTArray.shuffle(rand, indices);
algorithm.updateWeights(s_model, indices);
for (DEPTree tree : devTrees)
{
AbstractState state = process(tree, FLAG_DEVELOP, null);
goldLabels = (String[])state.getGoldLabels();
eval.countAccuracy(tree, goldLabels);
tree.setPOSTags((String[])goldLabels);
}
System.out.printf("%2d: %s\n", iter++, eval.toString());
currScore = eval.getAccuracies()[0];
eval.clear();
}
while (prevScore < currScore);
s_model.setWeights(prevWeights);
}