Package joshua.discriminative.training.risk_annealer

Examples of joshua.discriminative.training.risk_annealer.GradientComputer


          //=====compute onebest BLEU
          computeOneBestBLEU(curHypFilePrefix);
         
          //==== run DA annealer to obtain optimal weight vector using the hypergraphs as training data  
          HyperGraphFactory hgFactory = new HyperGraphFactory(curHypFilePrefix, referenceFiles, MRConfig.ngramStateID,  symbolTbl, this.haveRefereces);  
           GradientComputer gradientComputer = new HGRiskGradientComputer(MRConfig.useSemiringV2,
            numTrainingSentence, numPara, MRConfig.gainFactor, 1.0, 0.0, true,
              MRConfig.fixFirstFeature, hgFactory,
              MRConfig.maxNumHGInQueue, MRConfig.numThreads,
             
              MRConfig.ngramStateID,  MRConfig.baselineLMOrder, symbolTbl,
View Full Code Here


              }
            }
         
          //String f_nbest_merged_new = "C:/Users/zli/Documents/minriskannealer.nbest.merged.17";//????????????
          //String f_nbest_merged_new = "C:/Users/zli/Documents/minriskannealer.nbest.merged.1";//????????????
          GradientComputer gradientComputer = new NbestRiskGradientComputer(newNbestMergedFile, referenceFiles, useShortestRef, numTrainingSentence,
              numPara, MRConfig.gainFactor, 1.0, 0.0, true, MRConfig.linearCorpusGainThetas);
          annealer = new DeterministicAnnealer( numPara,  lastWeightVector, MRConfig.isMinimizer, gradientComputer,
              MRConfig.useL2Regula, MRConfig.varianceForL2, MRConfig.useModelDivergenceRegula, MRConfig.lambda, MRConfig.printFirstN);
         
          if(MRConfig.annealingMode==0)//do not anneal
View Full Code Here

TOP

Related Classes of joshua.discriminative.training.risk_annealer.GradientComputer

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.