Package cc.mallet.optimize

Examples of cc.mallet.optimize.Optimizable


        evaluateInstanceList (tt, instanceLists[k], instanceListDescriptions[k]);
  }
 
  protected void preamble (TransducerTrainer tt) {
    int iteration = tt.getIteration();
    Optimizable opt;
    if (tt instanceof TransducerTrainer.ByOptimization
        && (opt = ((TransducerTrainer.ByOptimization)tt).getOptimizer().getOptimizable()) instanceof Optimizable.ByValue)
      logger.info ("Evaluator iteration="+iteration+" cost="+((Optimizable.ByValue)opt).getValue());
    else
      logger.info ("Evaluator iteration="+iteration+" cost=NA (not Optimizable.ByValue)");
View Full Code Here


    one.addThruPipe(new ArrayIterator(data));
    CRF crf = new CRF(p, null);
    crf.addFullyConnectedStatesForThreeQuarterLabels(one);
    CRFTrainerByLabelLikelihood crft = new CRFTrainerByLabelLikelihood(crf);
    crf.setWeightsDimensionAsIn(one, false);
    Optimizable mcrf = crft.getOptimizableCRF(one);
    double[] params = new double[mcrf.getNumParameters()];
    for (int i = 0; i < params.length; i++) {
      params[i] = i;
    }
    mcrf.setParameters(params);
    crf.print();
  }
View Full Code Here

        evaluateInstanceList (ct, instanceLists[k], instanceListDescriptions[k]);
  }
 
  protected void preamble (ClassifierTrainer ct) {
    if (ct instanceof ClassifierTrainer.ByOptimization) {
      Optimizable opt;
      int iteration = ((ClassifierTrainer.ByOptimization)ct).getIteration();
      if ((opt = ((ClassifierTrainer.ByOptimization)ct).getOptimizer().getOptimizable()) instanceof Optimizable.ByValue)
        logger.info ("Evaluator iteration="+iteration+" cost="+((Optimizable.ByValue)opt).getValue());
      else
        logger.info ("Evaluator iteration="+iteration+" cost=NA (not Optimizable.ByValue)");
View Full Code Here

TOP

Related Classes of cc.mallet.optimize.Optimizable

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.