public boolean evaluate (ACRF acrf, int iter, InstanceList training, InstanceList validation, InstanceList testing) { boolean ret = true; for (Iterator it = evals.iterator (); it.hasNext ();) { ACRFEvaluator evaluator = (ACRFEvaluator) it.next (); // Return false (i.e., stop training) if any sub-evaluator does. ret = ret && evaluator.evaluate (acrf, iter, training, validation, testing); } return ret; }
public void test (ACRF acrf, InstanceList testing, ACRFEvaluator[] evals) { List pred = acrf.getBestLabels (testing); for (int i = 0; i < evals.length; i++) { evals[i].setOutputPrefix (outputPrefix); evals[i].test (testing, pred, "Testing"); } }
public void test (InstanceList gold, List returned, String description) { for (Iterator it = evals.iterator (); it.hasNext ();) { ACRFEvaluator eval = (ACRFEvaluator) it.next (); eval.test (gold, returned, description); } }
/** * @return true means stop, false means keep going (opposite of evaluators... ugh!) */ protected boolean callEvaluator (ACRF acrf, InstanceList trainingList, InstanceList validationList, InstanceList testSet, int iter, ACRFEvaluator eval) { if (eval == null) return false; // If no evaluator specified, keep going blindly eval.setOutputPrefix (outputPrefix); // don't cache test set boolean wasCached = acrf.isCacheUnrolledGraphs (); acrf.setCacheUnrolledGraphs (false); Timing timing = new Timing (); if (!eval.evaluate (acrf, iter+1, trainingList, validationList, testSet)) { logger.info ("ACRF trainer: evaluator returned false. Quitting."); timing.tick ("Evaluation time (iteration "+iter+")"); return true; } timing.tick ("Evaluation time (iteration "+iter+")"); // set test set caching back to normal acrf.setCacheUnrolledGraphs (wasCached); return false; }
public void test (InstanceList gold, List returned, String description) { for (Iterator it = evals.iterator (); it.hasNext ();) { ACRFEvaluator eval = (ACRFEvaluator) it.next (); eval.test (gold, returned, description); } }
/** * @return true means stop, false means keep going (opposite of evaluators... ugh!) */ protected boolean callEvaluator (ACRF acrf, InstanceList trainingList, InstanceList validationList, InstanceList testSet, int iter, ACRFEvaluator eval) { if (eval == null) return false; // If no evaluator specified, keep going blindly eval.setOutputPrefix (outputPrefix); // don't cache test set boolean wasCached = acrf.isCacheUnrolledGraphs (); acrf.setCacheUnrolledGraphs (false); Timing timing = new Timing (); if (!eval.evaluate (acrf, iter+1, trainingList, validationList, testSet)) { logger.info ("ACRF trainer: evaluator returned false. Quitting."); timing.tick ("Evaluation time (iteration "+iter+")"); return true; } timing.tick ("Evaluation time (iteration "+iter+")"); // set test set caching back to normal acrf.setCacheUnrolledGraphs (wasCached); return false; }
public void test (InstanceList gold, List returned, String description) { for (Iterator it = evals.iterator (); it.hasNext ();) { ACRFEvaluator eval = (ACRFEvaluator) it.next (); eval.test (gold, returned, description); } }
public void test (ACRF acrf, InstanceList testing, ACRFEvaluator[] evals) { List pred = acrf.getBestLabels (testing); for (int i = 0; i < evals.length; i++) { evals[i].setOutputPrefix (outputPrefix); evals[i].test (testing, pred, "Testing"); } }
/** * @return true means stop, false means keep going (opposite of evaluators... ugh!) */ protected boolean callEvaluator (ACRF acrf, InstanceList trainingList, InstanceList validationList, InstanceList testSet, int iter, ACRFEvaluator eval) { if (eval == null) return false; // If no evaluator specified, keep going blindly eval.setOutputPrefix (outputPrefix); // don't cache test set boolean wasCached = acrf.isCacheUnrolledGraphs (); acrf.setCacheUnrolledGraphs (false); Timing timing = new Timing (); if (!eval.evaluate (acrf, iter+1, trainingList, validationList, testSet)) { logger.info ("ACRF trainer: evaluator returned false. Quitting."); timing.tick ("Evaluation time (iteration "+iter+")"); return true; } timing.tick ("Evaluation time (iteration "+iter+")"); // set test set caching back to normal acrf.setCacheUnrolledGraphs (wasCached); return false; }
public boolean evaluate (ACRF acrf, int iter, InstanceList training, InstanceList validation, InstanceList testing) { boolean ret = true; for (Iterator it = evals.iterator (); it.hasNext ();) { ACRFEvaluator evaluator = (ACRFEvaluator) it.next (); // Return false (i.e., stop training) if any sub-evaluator does. ret = ret && evaluator.evaluate (acrf, iter, training, validation, testing); } return ret; }
public void test (ACRF acrf, InstanceList data, String description) { List ret = acrf.getBestLabels (data); test (data, ret, description); }
public void test (ACRF acrf, InstanceList testing, ACRFEvaluator[] evals) { List pred = acrf.getBestLabels (testing); for (int i = 0; i < evals.length; i++) { evals[i].setOutputPrefix (outputPrefix); evals[i].test (testing, pred, "Testing"); } }
public boolean evaluate (ACRF acrf, int iter, InstanceList training, InstanceList validation, InstanceList testing) { boolean ret = true; for (Iterator it = evals.iterator (); it.hasNext ();) { ACRFEvaluator evaluator = (ACRFEvaluator) it.next (); // Return false (i.e., stop training) if any sub-evaluator does. ret = ret && evaluator.evaluate (acrf, iter, training, validation, testing); } return ret; }
public void test (ACRF acrf, InstanceList data, String description) { List ret = acrf.getBestLabels (data); test (data, ret, description); }
public void test (ACRF acrf, InstanceList data, String description) { List ret = acrf.getBestLabels (data); test (data, ret, description); }
eval.test (acrf, testSet, "Testing"); acrf.setCacheUnrolledGraphs (oldCache);
eval.test (acrf, testSet, "Testing"); acrf.setCacheUnrolledGraphs (oldCache);
eval.test (acrf, testSet, "Testing"); acrf.setCacheUnrolledGraphs (oldCache);
eval.test (extor.getAcrf (), testing, "Final results");
eval.test (extor.getAcrf (), testing, "Final results");