Examples of Optimizer


Examples of cc.mallet.optimize.Optimizer

                        InstanceList testSet,
                        ACRFEvaluator eval,
                        int numIter,
                        Optimizable.ByGradientValue macrf)
  {
    Optimizer maximizer = createMaxer (macrf);
//    Maximizer.ByGradient maximizer = new BoldDriver ();
//    Maximizer.ByGradient maximizer = new GradientDescent ();
    boolean converged = false;
    boolean resetOnError = true;
    long stime = System.currentTimeMillis ();

    int numNodes = (macrf instanceof ACRF.MaximizableACRF) ? ((ACRF.MaximizableACRF) macrf).getTotalNodes () : 0;
    double thresh = 1e-5 * numNodes; // "early" stopping (reasonably conservative)

    if (testSet == null) {
      logger.warning ("ACRF trainer: No test set provided.");
    }

    double prevValue = Double.NEGATIVE_INFINITY;
    double currentValue;
    int iter;
    for (iter = 0; iter < numIter; iter++) {
      long etime = new java.util.Date ().getTime ();
      logger.info ("ACRF trainer iteration " + iter + " at time " + (etime - stime));

      try {
        converged = maximizer.optimize (1);
        converged |= callEvaluator (acrf, trainingList, validationList, testSet, iter, eval);

        if (converged) break;
        resetOnError = true;

View Full Code Here

Examples of cc.mallet.optimize.Optimizer

    */

    omemm = new MEMMOptimizableByLabelLikelihood (memm, training);
    // Gather the constraints
    omemm.gatherExpectationsOrConstraints (true);
    Optimizer maximizer = new LimitedMemoryBFGS(omemm);
    int i;
//    boolean continueTraining = true;
    boolean converged = false;
    logger.info ("CRF about to train with "+numIterations+" iterations");
    for (i = 0; i < numIterations; i++) {
      try {
        converged = maximizer.optimize (1);
        logger.info ("CRF finished one iteration of maximizer, i="+i);
        runEvaluators();
      } catch (IllegalArgumentException e) {
        e.printStackTrace();
        logger.info ("Catching exception; saying converged.");
View Full Code Here

Examples of cc.mallet.optimize.Optimizer

  public MaxEnt train (InstanceList trainingSet)
  {
    logger.fine ("trainingSet.size() = "+trainingSet.size());
    RankMaxEntTrainer.MaximizableTrainer mt =
      new RankMaxEntTrainer.MaximizableTrainer (trainingSet, (RankMaxEnt)initialClassifier);
    Optimizer maximizer = new LimitedMemoryBFGS(mt);

  //  maximizer.optimize (); // XXX given the loop below, this seems wrong.
     boolean converged;

     for (int i = 0; i < numIterations; i++) {
      try {
        converged = maximizer.optimize (1);
      } catch (IllegalArgumentException e) {
        e.printStackTrace();
        logger.info ("Catching exception; saying converged.");
        converged = true;
      }
View Full Code Here

Examples of cc.mallet.optimize.Optimizer

  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++) {
View Full Code Here

Examples of client.net.sf.saxon.ce.expr.Optimizer

     * Static analysis: prevent sorting of the argument
     */

    public void checkArguments(ExpressionVisitor visitor) throws XPathException {
        super.checkArguments(visitor);
        Optimizer opt = visitor.getConfiguration().getOptimizer();
        argument[0] = ExpressionTool.unsorted(opt, argument[0], true);
        // we don't care about the order of the results, but we do care about how many nodes there are
    }
View Full Code Here

Examples of client.net.sf.saxon.ce.expr.Optimizer

     * @return the optimizer used in this configuration
     */

    public Optimizer getOptimizer() {
        if (optimizer == null) {
            optimizer = new Optimizer(this);
            optimizer.setOptimizationLevel(optimizationLevel);
        }
        return optimizer;
    }
View Full Code Here

Examples of com.barrybecker4.optimization.Optimizer

        ParameterArray initialGuess = new TantrixPath(board);
        assert(initialGuess.size() > 0) : "The random path should have some tiles!";
        long startTime = System.currentTimeMillis();

        Optimizer optimizer = new Optimizer(this);
        optimizer.setListener(this);

        ParameterArray solution =
            optimizer.doOptimization(strategy, initialGuess, SOLVED_THRESH);

        solution_ =
            new TantrixBoard(((TantrixPath)solution).getTilePlacements(), board.getPrimaryColor());

        TilePlacementList moves;
View Full Code Here

Examples of com.voltvoodoo.brew.Optimizer

            {
                coffeeScriptOptions.add( CoffeeScriptOption.BARE );
            }
           
            hamlCompiler = new HamlCompiler(force);
            moduleConverter = new Optimizer();
            coffeeCompiler = new CoffeeScriptCompiler(coffeeScriptOptions,force);

            for ( String relativePath : getCoffeeScriptsRelativePaths() )
            {
                try
View Full Code Here

Examples of de.mpi.rgblab.optimizer.Optimizer

  // }

  public void optimize(int distance, int surroundAngle) {
    int radiusView =  VisUtil.getViewRadius(distance);
    int radiusSurround =  VisUtil.getRadius(distance, surroundAngle);
    Optimizer opt = new Optimizer();
    classColors = opt.optimize(data, classColors, radiusSurround, radiusView);
    update(-1);
  }
View Full Code Here

Examples of de.mpi.rgblab.optimizer.Optimizer

   
   
//    data.computeSaliency(radius, classColors);
//    data.computeVisibility(radius);
//    data.export(args[2]);
    Optimizer opt = new Optimizer(logFile); //, 0.60, 6);
    classColors = opt.optimize(data, classColors, radiusView, radiusSurround);
    LogUtil l = new LogUtil(outputFile, true);
   
    for (int i =0; i< classColors.size(); i++) {
      l.log(Integer.toString(Math.round((float)classColors.get(i).getDimension_1())));
      l.log(",");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.