• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ACRFEvaluator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中cc.mallet.grmm.learning.ACRFEvaluator的典型用法代码示例。如果您正苦于以下问题:Java ACRFEvaluator类的具体用法?Java ACRFEvaluator怎么用?Java ACRFEvaluator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ACRFEvaluator类属于cc.mallet.grmm.learning包,在下文中一共展示了ACRFEvaluator类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: incrementalTrain

import cc.mallet.grmm.learning.ACRFEvaluator; //导入依赖的package包/类
public boolean incrementalTrain (ACRF acrf,
                                 InstanceList training,
                                 InstanceList validation,
                                 InstanceList testing,
                                 ACRFEvaluator eval,
                                 int numIter)
{
  long stime = new Date ().getTime ();
  for (int i = 0; i < SIZE.length; i++) {
    InstanceList subset = training.split (new double[]
            {SIZE[i], 1 - SIZE[i]})[0];
    logger.info ("Training on subset of size " + subset.size ());
    Optimizable.ByGradientValue subset_macrf = createOptimizable (acrf, subset);
    train (acrf, training, validation, null, eval,
            SUBSET_ITER, subset_macrf);
    logger.info ("Subset training " + i + " finished...");
  }
  long etime = new Date ().getTime ();
  logger.info ("All subset training finished.  Time = " + (etime - stime) + " ms.");
  return train (acrf, training, validation, testing, eval, numIter);
}
 
开发者ID:mimno,项目名称:GRMM,代码行数:22,代码来源:DefaultAcrfTrainer.java


示例2: callEvaluator

import cc.mallet.grmm.learning.ACRFEvaluator; //导入依赖的package包/类
/**
 * @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;
}
 
开发者ID:mimno,项目名称:GRMM,代码行数:29,代码来源:DefaultAcrfTrainer.java


示例3: someUnsupportedTrain

import cc.mallet.grmm.learning.ACRFEvaluator; //导入依赖的package包/类
public boolean someUnsupportedTrain (ACRF acrf,
                      InstanceList trainingList,
                      InstanceList validationList,
                      InstanceList testSet,
                      ACRFEvaluator eval,
                      int numIter)
{

  Optimizable.ByGradientValue macrf = createOptimizable (acrf, trainingList);
  train (acrf, trainingList, validationList, testSet, eval, 5, macrf);
  ACRF.Template[] tmpls = acrf.getTemplates ();
  for (int ti = 0; ti < tmpls.length; ti++)
    tmpls[ti].addSomeUnsupportedWeights (trainingList);
  logger.info ("Some unsupporetd weights initialized.  Training...");
  return train (acrf, trainingList, validationList, testSet, eval, numIter, macrf);
}
 
开发者ID:mimno,项目名称:GRMM,代码行数:17,代码来源:DefaultAcrfTrainer.java


示例4: train

import cc.mallet.grmm.learning.ACRFEvaluator; //导入依赖的package包/类
public boolean train (ACRF acrf,
                      InstanceList trainingList,
                      InstanceList validationList,
                      InstanceList testSet,
                      ACRFEvaluator eval,
                      int numIter)
{
  Optimizable.ByGradientValue macrf = createOptimizable (acrf, trainingList);
  return train (acrf, trainingList, validationList, testSet,
          eval, numIter, macrf);
}
 
开发者ID:mimno,项目名称:GRMM,代码行数:12,代码来源:DefaultAcrfTrainer.java


示例5: test

import cc.mallet.grmm.learning.ACRFEvaluator; //导入依赖的package包/类
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");
  }
}
 
开发者ID:mimno,项目名称:GRMM,代码行数:9,代码来源:DefaultAcrfTrainer.java


示例6: evaluate

import cc.mallet.grmm.learning.ACRFEvaluator; //导入依赖的package包/类
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;
}
 
开发者ID:mimno,项目名称:GRMM,代码行数:11,代码来源:AcrfSerialEvaluator.java


示例7: test

import cc.mallet.grmm.learning.ACRFEvaluator; //导入依赖的package包/类
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);
  }
}
 
开发者ID:mimno,项目名称:GRMM,代码行数:8,代码来源:AcrfSerialEvaluator.java



注:本文中的cc.mallet.grmm.learning.ACRFEvaluator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ApacheHttpClient类代码示例发布时间:2022-05-22
下一篇:
Java ObjectDifferBuilder类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap