Examples of ConjugateGradient


Examples of algo.ConjugateGradient

    for (double element : obj.params) {
      log.warn(element + " ");
    }
    //System.out.println();
    obj.reset();
    ConjugateGradient cg = new ConjugateGradient(obj.params.length);
    cg.maximize(obj);
    log.warn("Conjugate gradient found params (val="
        + obj.numValueCalls + " grad=" + obj.numGradientCalls + "): ");
    for (double element : obj.params) {
      log.warn(element + " ");
    }
View Full Code Here

Examples of algo.ConjugateGradient

      ArrayList<ClassificationInstance> trainingData) {
    Objective obj = new Objective(trainingData);
    // perform gradient descent
    @SuppressWarnings("unused")
    GradientAscent gaoptimizer;
    ConjugateGradient optimizer = new ConjugateGradient(obj
        .getNumParameters());
    @SuppressWarnings("unused")
    boolean success = optimizer.maximize(obj);
    System.out.println("valCalls = " + obj.numValueCalls
        + "   gradientCalls=" + obj.numGradientCalls);
    return obj.classifier;
  }
View Full Code Here

Examples of algo.ConjugateGradient

    for (int i = 0; i < obj.params.length; i++) {
      System.out.print(obj.params[i] + " ");
    }
    System.out.println();
    obj.reset();
    ConjugateGradient cg = new ConjugateGradient(obj.params.length);
    cg.maximize(obj);
    System.out.println("Conjugate gradient found params (val="
        + obj.numValueCalls + " grad=" + obj.numGradientCalls + "): ");
    for (int i = 0; i < obj.params.length; i++) {
      System.out.print(obj.params[i] + " ");
    }
View Full Code Here

Examples of algo.ConjugateGradient

  public LinearTagger batchTrain(ArrayList<SequenceInstance> trainingData) {
    Objective obj = new Objective(trainingData);
    // perform gradient descent
    @SuppressWarnings("unused")
    GradientAscent gaoptimizer = new GradientAscent();
    @SuppressWarnings("unused")
    ConjugateGradient optimizer = new ConjugateGradient(obj
        .getNumParameters());
    @SuppressWarnings("unused")
    boolean success = optimizer.maximize(obj);
    System.out.println("valCalls = " + obj.numValueCalls
        + "   gradientCalls=" + obj.numGradientCalls);
    return obj.tagger;
  }
View Full Code Here

Examples of cc.mallet.optimize.ConjugateGradient

    }
     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.
      optimizer = new ConjugateGradient(mt);
      try {
        optimizer.optimize ();
      } catch (IllegalArgumentException e) {
        e.printStackTrace();
        logger.info ("Catching exception; saying converged.");
View Full Code Here

Examples of cc.mallet.optimize.ConjugateGradient

  //  OPTIMIZER OBJECT: maximizes value function
  //

  public Optimizer getOptimizer () {
    if (optimizer == null && optimizable != null) {
      optimizer = new ConjugateGradient(optimizable);
    }

    return optimizer;
  }
View Full Code Here

Examples of cc.mallet.optimize.ConjugateGradient

  //  OPTIMIZER OBJECT: maximizes value function
  //

  public Optimizer getOptimizer () {
    if (optimizer == null && optimizable != null) {
      optimizer = new ConjugateGradient(optimizable);
    }

    return optimizer;
  }
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.