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 (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 (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; }
/** * @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; }
/** * @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; }