From: Aaron A. <aa...@us...> - 2008-08-15 21:38:17
|
Update of /cvsroot/jboost/jboost/src/jboost/monitor In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv23932/monitor Modified Files: Monitor.java Log Message: More commits related to removing ControllerConfiguration, Also now outputs training and testing info files at the end of all BrownBoost classes Index: Monitor.java =================================================================== RCS file: /cvsroot/jboost/jboost/src/jboost/monitor/Monitor.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Monitor.java 4 Jul 2008 22:34:57 -0000 1.10 --- Monitor.java 15 Aug 2008 21:38:13 -0000 1.11 *************** *** 11,15 **** import jboost.booster.Booster; import jboost.booster.BrownBoost; ! import jboost.controller.ControllerConfiguration; import jboost.controller.Configuration; import jboost.examples.ExampleSet; --- 11,15 ---- import jboost.booster.Booster; import jboost.booster.BrownBoost; ! import jboost.controller.Configuration; import jboost.controller.Configuration; import jboost.examples.ExampleSet; *************** *** 95,99 **** */ public Monitor(Booster booster, ExampleSet training, ! ExampleSet testing, ControllerConfiguration config) { trainSet= training; testSet= testing; --- 95,99 ---- */ public Monitor(Booster booster, ExampleSet training, ! ExampleSet testing, Configuration config) { trainSet= training; testSet= testing; *************** *** 128,139 **** boostingPrintRate= config.getInt("a", 0); ! if (boostingPrintRate != 0) { ! trainBoostingStream = new PrintWriter( ! new BufferedWriter( ! new FileWriter(trainBoostingFilename))); ! testBoostingStream = new PrintWriter( ! new BufferedWriter( ! new FileWriter(testBoostingFilename))); ! } afterInitTime= new Date(); infoStream.println("Init Start time = " + startTime); --- 128,138 ---- boostingPrintRate= config.getInt("a", 0); ! trainBoostingStream = new PrintWriter( ! new BufferedWriter( ! new FileWriter(trainBoostingFilename))); ! testBoostingStream = new PrintWriter( ! new BufferedWriter( ! new FileWriter(testBoostingFilename))); ! afterInitTime= new Date(); infoStream.println("Init Start time = " + startTime); *************** *** 278,300 **** /** output the scores distribution of the training set */ private void logBoosting(int iter, Predictor combined, Predictor base) { ! if (boostingPrintRate == 0 || ! (boostingPrintRate > 0 && boostingPrintRate != iter)) ! return; ! if (boostingPrintRate == -1) { ! // print score when highest order digit in iter changes. ! double m= ! java.lang.Math.floor( ! java.lang.Math.log(iter) / java.lang.Math.log(10.0)); ! int t= (int) java.lang.Math.pow(10.0, m); ! if (iter == 0) ! t= 1; // fix bug in "pow" ! if ((iter % t) != 0) ! return; } ! logBoostingTrainTest(trainBoostingStream, trainSet, iter, combined, base); ! logBoostingTrainTest(testBoostingStream, testSet, iter, combined, base); ! trainBoostingStream.flush(); ! testBoostingStream.flush(); ! infoStream.print(" \t# output boosting data #"); } --- 277,306 ---- /** output the scores distribution of the training set */ private void logBoosting(int iter, Predictor combined, Predictor base) { ! if (boostingPrintRate == 0 && m_booster instanceof BrownBoost) { ! BrownBoost b = (BrownBoost) m_booster; ! if (!b.isFinished()) { ! return; } ! } ! if ((boostingPrintRate==0 && !(m_booster instanceof BrownBoost)) || ! (boostingPrintRate > 0 && boostingPrintRate != iter)) ! return; ! ! if (boostingPrintRate == -1) { ! // print score when highest order digit in iter changes. ! double m= ! java.lang.Math.floor( ! java.lang.Math.log(iter) / java.lang.Math.log(10.0)); ! int t= (int) java.lang.Math.pow(10.0, m); ! if (iter == 0) ! t= 1; // fix bug in "pow" ! if ((iter % t) != 0) ! return; ! } ! logBoostingTrainTest(trainBoostingStream, trainSet, iter, combined, base); ! logBoostingTrainTest(testBoostingStream, testSet, iter, combined, base); ! trainBoostingStream.flush(); ! testBoostingStream.flush(); ! infoStream.print(" \t# output boosting data #"); } |