Package cc.mallet.optimize

Examples of cc.mallet.optimize.LimitedMemoryBFGS


    // Build a new optimizer
    if (optimizer == null) {
      // If l1Weight is 0, this devolves to
      //  standard L-BFGS, but the implementation
      //  may be faster.
      optimizer = new LimitedMemoryBFGS(optimizable);
      //OrthantWiseLimitedMemoryBFGS(optimizable, l1Weight);
    }
    return optimizer;
  }
View Full Code Here


  }

  private Optimizer createMaxer (Optimizable.ByGradientValue macrf)
  {
    if (maxer == null) {
      return new LimitedMemoryBFGS (macrf);
    } else return maxer;
  }
View Full Code Here

    }
   
    ge = new MaxEntOptimizableByGE(trainingList,constraints,classifier);
    ge.setTemperature(temperature);
    ge.setGaussianPriorVariance(gaussianPriorVariance);
    opt = new LimitedMemoryBFGS(ge);
   
    logger.fine ("trainingList.size() = "+trainingList.size());
    boolean converged;

    for (int i = 0; i < numIterations; i++) {
      try {
        converged = opt.optimize (1);
      } catch (Exception e) {
        e.printStackTrace();
        logger.info ("Catching exception; saying converged.");
        converged = true;
      }
      if (converged)
        break;
    }

    if (numIterations == Integer.MAX_VALUE) {
      // Run it again because in our and Sam Roweis' experience, BFGS can still
      // eke out more likelihood after first convergence by re-running without
      // being restricted by its gradient history.
      opt = new LimitedMemoryBFGS(ge);
      try {
        opt.optimize ();
      } catch (Exception e) {
        e.printStackTrace();
        logger.info ("Catching exception; saying converged.");
View Full Code Here

TOP

Related Classes of cc.mallet.optimize.LimitedMemoryBFGS

Copyright © 2018 www.massapicom. 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.