Package org.fnlp.ml.classifier.linear.update

Examples of org.fnlp.ml.classifier.linear.update.Update


    loadTrainingData();
    /**
     *
     * 更新参数的准则
     */
    Update update;
    // viterbi解码
    Inferencer inference;

    HammingLoss loss = new HammingLoss();
    if (standard) {
View Full Code Here


      InstanceSet instset = new InstanceSet(pipe,factory);
      instset.loadThruStagePipes(new SimpleFileReader(trainFile," ",true,Type.LabelData));
      Generator gen = new SFGenerator();
      ZeroOneLoss l = new ZeroOneLoss();
      Inferencer ms = new LinearMax(gen, factory.getLabelSize());
      Update update = new LinearMaxPAUpdate(l);
      OnlineTrainer trainer = new OnlineTrainer(ms, update,l, factory.getFeatureSize(), 50,0.005f);
      Linear pclassifier = trainer.train(instset,instset);
      pipe.removeTargetPipe();
      pclassifier.setPipe(pipe);
      factory.setStopIncrement(true);
View Full Code Here


    // viterbi解码
    HammingLoss loss = new HammingLoss();
    Inferencer inference = new LinearViterbi(templets, labels.size());
    Update update = new LinearViterbiPAUpdate((LinearViterbi) inference, loss);


    OnlineTrainer trainer = new OnlineTrainer(inference, update, loss,
        features.size(), 50,0.1f);
View Full Code Here

    /**
     *
     * 更新参数的准则
     */
    Update update;
    // viterbi解码
    Inferencer inference;
    boolean standard = true;
    HammingLoss loss = new HammingLoss();
    if (standard) {
View Full Code Here

      int ysize = alphabet.size();
      System.out.printf("Training with data: %s\n", pos);
      System.out.printf("Number of labels: %d\n", ysize);
      LinearMax solver = new LinearMax(generator, ysize);
      ZeroOneLoss loss = new ZeroOneLoss();
      Update update = new LinearMaxPAUpdate(loss);
      OnlineTrainer trainer = new OnlineTrainer(solver, update, loss,
          fsize, maxite, c);
      models[i] = trainer.train(instset, null);
      instset = null;
      solver = null;
View Full Code Here

    LabelAlphabet la = factory.DefaultLabelAlphabet();
    int ysize = la.size();
    System.out.printf("开始训练");
    LinearMax solver = new LinearMax(generator, ysize);
    ZeroOneLoss loss = new ZeroOneLoss();
    Update update = new LinearMaxPAUpdate(loss);
    OnlineTrainer trainer = new OnlineTrainer(solver, update, loss,
        fsize, maxite, c);
    Linear models = trainer.train(instset, null);
    instset = null;
    solver = null;
View Full Code Here

TOP

Related Classes of org.fnlp.ml.classifier.linear.update.Update

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.