private void setupAcrf (ACRF acrf) { if (cacheUnrolledGraphs) acrf.setCacheUnrolledGraphs (true); if (inferencer != null) acrf.setInferencer (inferencer); if (viterbiInferencer != null) acrf.setViterbiInferencer (viterbiInferencer); }
private void setupAcrf (ACRF acrf) { if (cacheUnrolledGraphs) acrf.setCacheUnrolledGraphs (true); if (inferencer != null) acrf.setInferencer (inferencer); if (viterbiInferencer != null) acrf.setViterbiInferencer (viterbiInferencer); }
private void setupAcrf (ACRF acrf) { if (cacheUnrolledGraphs) acrf.setCacheUnrolledGraphs (true); if (inferencer != null) acrf.setInferencer (inferencer); if (viterbiInferencer != null) acrf.setViterbiInferencer (viterbiInferencer); }
/** * @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; }
acrf.setCacheUnrolledGraphs (false); eval.test (acrf, testSet, "Testing"); acrf.setCacheUnrolledGraphs (oldCache);
acrf.setCacheUnrolledGraphs (false); eval.test (acrf, testSet, "Testing"); acrf.setCacheUnrolledGraphs (oldCache);
acrf.setCacheUnrolledGraphs (false); eval.test (acrf, testSet, "Testing"); acrf.setCacheUnrolledGraphs (oldCache);