本文整理汇总了Java中cc.mallet.optimize.Optimizer类的典型用法代码示例。如果您正苦于以下问题:Java Optimizer类的具体用法?Java Optimizer怎么用?Java Optimizer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Optimizer类属于cc.mallet.optimize包,在下文中一共展示了Optimizer类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: train
import cc.mallet.optimize.Optimizer; //导入依赖的package包/类
public MCMaxEnt train (InstanceList trainingSet)
{
logger.fine ("trainingSet.size() = "+trainingSet.size());
mt = new MaximizableTrainer (trainingSet, (MCMaxEnt)initialClassifier);
Optimizer maximizer = new LimitedMemoryBFGS(mt);
// CPAL - change the tolerance for large vocab experiments
((LimitedMemoryBFGS)maximizer).setTolerance(.00001); // std is .0001;
maximizer.optimize (); // XXX given the loop below, this seems wrong.
logger.info("MCMaxEnt ngetValueCalls:"+getValueCalls()+"\nMCMaxEnt ngetValueGradientCalls:"+getValueGradientCalls());
// boolean converged;
//
// for (int i = 0; i < numIterations; i++) {
// converged = maximizer.maximize (mt, 1);
// if (converged)
// break;
// else if (evaluator != null)
// if (!evaluator.evaluate (mt.getClassifier(), converged, i, mt.getValue(),
// trainingSet, validationSet, testSet))
// break;
// }
// TestMaximizable.testValueAndGradient (mt);
progressLogger.info("\n"); // progess messages are on one line; move on.
return mt.getClassifier ();
}
示例2: getMaxer
import cc.mallet.optimize.Optimizer; //导入依赖的package包/类
public Optimizer getMaxer ()
{
return maxer;
}
示例3: setMaxer
import cc.mallet.optimize.Optimizer; //导入依赖的package包/类
public void setMaxer (Optimizer maxer)
{
this.maxer = maxer;
}
示例4: createMaxer
import cc.mallet.optimize.Optimizer; //导入依赖的package包/类
private Optimizer createMaxer (Optimizable.ByGradientValue macrf)
{
if (maxer == null) {
return new LimitedMemoryBFGS (macrf);
} else return maxer;
}
示例5: getOptimizer
import cc.mallet.optimize.Optimizer; //导入依赖的package包/类
public Optimizer getOptimizer() {
return bfgs;
}
示例6: getOptimizer
import cc.mallet.optimize.Optimizer; //导入依赖的package包/类
public Optimizer getOptimizer() {
return bfgs;
}
开发者ID:kostagiolasn,项目名称:NucleosomePatternClassifier,代码行数:4,代码来源:CRFTrainerByEntropyRegularization.java
示例7: setOptimizable
import cc.mallet.optimize.Optimizer; //导入依赖的package包/类
public void setOptimizable(Optimizer optimizer) {
this.optimizer = optimizer;
}
示例8: setOptimizer
import cc.mallet.optimize.Optimizer; //导入依赖的package包/类
public void setOptimizer(Optimizer opt) {
this.opt = opt;
}
示例9: getOptimizer
import cc.mallet.optimize.Optimizer; //导入依赖的package包/类
public Optimizer getOptimizer() {
throw new RuntimeException("Not yet implemented!");
}
示例10: getOptimizer
import cc.mallet.optimize.Optimizer; //导入依赖的package包/类
public Optimizer getOptimizer() {
return opt;
}